Hardcore Apache question: How to have an .htaccess file pull from WordPress?
July 24, 2006 7:56 PM
Subscribe
Hardcore Apache question: How can I write an .htaccess file that will apply a RewriteRule to only the most recent file posted to my Wordpress blog?
I post a video a day on my site, and I need to redirect the traffic to the most recent video to libsyn, which is set up for the traffic patterns caused by podcasts -- otherwise, my server runs sluggishly for a few hours every morning. The WordPress posts are written using a custom field which contains the URL of the video file to be posted, and I can hack WordPress to output a file containing only this URL. How can I write an .htaccess file that will compare the request string to the contents of this file, so that the URL of the most recent video will be automatically overwritten?
Note that I'm not extremely conversant with the details of Apache configuration -- I've modified the regexps of a few RewriteRules that a friend wrote for me, but that's about it -- so the fuller the code sample, the better. Barring that, I'm a quick study, so a link to a syntax reference would do me fine as well.
Thanks!
posted by tweebiscuit to computers & internet (13 comments total)
1 user marked this as a favorite
Barring that, hmm, you may be out of luck with a rewrite solution. I don't see any way to read a file for rewriting purposes. It might be worth looking into writing a small cgi script (in php or whatever language) that people would hit to get the video, and it'd redirect them to the appropriate place. Not as clean, but it'd work.
posted by inkyz at 8:21 PM on July 24, 2006