Hi.. I need to do this.. From http://www.yourdomain.com/index.php?expansion={expansion}&seed={seed}&final={final} to http://www.yourdomain.com/{expansion}/{seed}/{final} In .htaccess file RewriteEngine on RewriteRule ^([^/\.]+)/([^/\.]+)/[^/\.]+)/?$ index.php?expansion=$1&seed=$2&final=$3 [L] Code (markup): It doesn't rewrite the URL.. This is the another code that I get from other forum. http://forum.modrewrite.com/viewtopic.php?p=15084&sid=427975dd881fdcdae0c410de104c2bf4 Options +FollowSymLinks RewriteEngine On RewriteRule ^seed/([^/]+)/expansion/final/?$ ./index.php?seed=$1&expansion=$1&final=$1 [QSA,L] RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteCond %{QUERY_STRING} ^(.*&)?seed=([^&]+)(&.*)?$ [NC] RewriteRule ^index\.php$ /ppc/seed/%2/expansion/final/? [R=301,L] Code (markup): It doesn't rewrite the URL as well. Anyone can help? Thank you.
ok.. the second code does work and I've modify it accordingly.. but the output URL doesn't point back to index.php . Have I miss something? I actually just want to hide the passing variable from showing just like this one.. http://www.yourdomain.com/index.php?seed=test to http://www.yourdomain.com or http://www.yourdomain.com/test but actually still pointing to index.php file.
Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^([^.]+)/([^.]+)/([^.]+)$ index.php?expansion=$1&seed=$2&final=$3 [L] Links have to be edited to link to the new URLs.
Hi Nintendo, thanks for your help. Can you explain more about what do you mean by Links have to be edited to link to the new URLs? I've try the code but it doesn't change the URL.
If you link to the dynamic URLs, you won't get mod_rewrite URLs. mod_rewrite doesn't change links, you have to edit the script yourself. It's like thinking you can change files from .asp to .php and the URLs will magically change with out editing the code that spits out the links.