Posted by:
toumimi
(---.44.75-86.rev.gaoland.net)
Yep.
If you want to associate a rewrited url (fake) to a real url (with file on your server and params in $_GET),
then you have to use example given by c2dan.
But you still can go to your old urls (profile.php) by typing it directly in browser.
It is still valid unless you tell Apache to forbid this url, or better, to redirect 301 to the new rewrited url.
To do so, you have to use a little hack, by adding a parameter when redirecting, to avoir infinite loop,
from new to old, old to new, etc.
You should use something like that to redirect old urls to new ones, so both are working.
RewriteCond %{QUERY_STRING} ^action=(.*)$
RewriteRule ^profile\.php$ /accounts/%1/? [R=301,L]
RewriteRule ^accounts/{$username}/ profile.php?action={$username}&rewriting [L]
If it's does not exactly fit your problem, you can play around this, because this one should work.
Don't forget to generate new urls or your website will contain only 301 redirections, which is really bad for loadings and referencement.
Good luck
Florian
WampServer Patch (
Screenshots)
Topic EN :
www.wampserver.comTopic FR :
www.wampserver.com