as the title says im a rookie in the ‘URL Rewriting’ field and i’d like to ask a question that could help many others like me.
Let’s say we have an url like this:
http://myepicsite.wow/index.php?value_x=1&value_y=2&value_z=3
How can one rewrite this url to something like this(seofriendly) without writing a line of code for every page that is generated from those _GET[] variables? :
http://myepicsite.wow/index.php/1/2/3
2
Answers
Try adding this to your
.htaccess
Try:
Then you just need to make sure your links all look like
http://myepicsite.wow/index.php/1/2/3
.However, you can already read these from index.php even without a rewrite rule. In your index.php script, you should be able to read the
$_SERVER['PATH_INFO']
variable and see/1/2/3
, then just explode that into an array and assign them to the value_x/y/z variables.