Forum Moderators: phranque
I've been using Apache for a while and always figured that learning how to use mod_rewrite would be a good thing. So yesterday I started looking at it properly as I wanted to set up a table of contents listing for my flash files via a php script. All this I got working ok - the toc of flash files all link to one main file which then loads them in as requested. <snip>. Then came the point at which I wanted to disguise the query string behind a nice, logically readable URL. I figured that the following would do the trick in my httpd.conf file:
RewriteRule ^/helvector/httpdocs/(exp/)(lab/)/([^/]*)/([^/]*)$ /helvector/httpdocs/index.htm?experiment=$2/$3/$4 Which works but the trouble is that the flash file's that are refrenced from within the html are relative so the browser asks apache for them via the same url, so the re_write module (quite correctly) serves the same index.htm file again.
I've got round it in a way by adding a base href to the html but this has had a weird nock on effect for the flash files that I'm still investigating. It also means that I have to check where the file's being executed from (ie is it my live or test domain) and write the base ref accordingly.
I'm hoping that someone has a more elegant solution to offer?
I'd also be greatful if someone could suggest how I get the match to fire only when something from the /helvector/httpdocs/ directory is requested. So far I've tried various incarnations of
<Directory "/Users/db/Sites/helvector/httpdocs">
#rewrite rule
</Directory> Thanks,
db
[edited by: jdMorgan at 4:32 pm (utc) on Feb. 27, 2005]
[edit reason] Removed specifics per TOS. [/edit]