tags:

views:

73

answers:

2

Here is my current htaccess code:

(turn engine on and such) RewriteRule ^foo.xml$ bar.php [NC]

This code works fanstastic on domain names like foobar.com, etc. It does not work for temporary domains like such:

bar.com/~foo/

Is there a work around for this? Any help greatly appreciated!

+1  A: 

The RegEx you are checking with is evaluating if foo.xml is the request, but with folders, the request would be more like ~foo/foo.xml. Add another rule:

RewriteRule ^(.+)/foo.xml$ bar.php [NC]

I didn't check it yet, but something like that should help.

St. John Johnson
+1  A: 

Try this rule:

RewriteRule ^(.+/)?foo\.xml$ $1bar.php
Gumbo