drewprops
2012-03-15, 14:55
I recently made the mental leap to understanding how to serve up URLs to mod_rewrite so that I have pretty URLs in some of my simple websites.
I need some help though, when it comes to using a 301 Redirect to 'clean up' the URL when people hit the website from an old PHP-encrusted link.
For example:
Suppose that someone clicks an old-fashioned URL to our site, and that the page still exists at:
example.com/index.php?x=foo
but we want it to look like this:
example.com/foo
in their browser's navigation bar, as it does when clicked upon from any navigation links internal to this website.
I thought that using a redirect in this fashion:
Redirect 301 /index.php?x=foo http://example.com/foo
would work just fine, but of course it does not.
Any insight you folks could provide would be appreciated.
...
I need some help though, when it comes to using a 301 Redirect to 'clean up' the URL when people hit the website from an old PHP-encrusted link.
For example:
Suppose that someone clicks an old-fashioned URL to our site, and that the page still exists at:
example.com/index.php?x=foo
but we want it to look like this:
example.com/foo
in their browser's navigation bar, as it does when clicked upon from any navigation links internal to this website.
I thought that using a redirect in this fashion:
Redirect 301 /index.php?x=foo http://example.com/foo
would work just fine, but of course it does not.
Any insight you folks could provide would be appreciated.
...