Valleriani
asked on
Rewrite rule with HTACCESS - Changing a link
I have a current RewriteRule like this for HTACCESS
RewriteRule ^([a]{1})([^/]+)/(.+)$ /track_folder/$3 [L] #big rewrite tracking folder, only A
Which will change something like
http://domain.com/apple/5512-3311/
to
http://domain.com/track_folder/5512-3311.php
However, I moved away from static files and I am using MYSQL now with one file. I need something like
http://domain.com/apple/5512-3311/
to become
http://domain.com/track_folder/index.php?id=5512-3311
How could I adjust my current rule to do this to redirect always to index.php with a variable?
Thanks!
RewriteRule ^([a]{1})([^/]+)/(.+)$ /track_folder/$3 [L] #big rewrite tracking folder, only A
Which will change something like
http://domain.com/apple/5512-3311/
to
http://domain.com/track_folder/5512-3311.php
However, I moved away from static files and I am using MYSQL now with one file. I need something like
http://domain.com/apple/5512-3311/
to become
http://domain.com/track_folder/index.php?id=5512-3311
How could I adjust my current rule to do this to redirect always to index.php with a variable?
Thanks!
RewriteRule ^apple/*(.*)$ index.php?id=$1 [L,R,NC]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. This one worked exactly for all my links.