I’m trying to redirect something like foo/bar to ?foo=bar, so I can do www.mydomain.com/hey/foo/bar to www.mydomain.com/hey/?foo=bar, but I can’t seem to get the syntax right. I tried the following:
RewriteEngine on
RewriteRule ^foo/(.*)$ ?foo=bar [NC]
But this doesn’t work. How would I accomplish this? I tried adding a forward slash behind the question mark, but that makes it link to the root directory.
Thanks,
Jengerer
Well, it turns out that the problem wasn’t in the redirection, but in the links that were made after the redirection.
After redirecting from
/foo/barto/?foo=bar, the CSS links and images were poorly matched because it was now looking for local links within the/foo/bardirectory, which doesn’t exist. What an interesting ‘glitch’.