I want to use apache rewrite module to do complex rewriting.
For example
If the url is http://www.site.com/wall and http://www.site.com/profile and http://www.site.com/info I want to rewrite into http://www.site.com/gotopage.php?page=wall ,or http://www.site.com/gotopage.php?page=profile and so forth
But if the url is other than that I want to pass it the other way
For example. if the url is http://www.site.com/newthing then it should rewrite as http://www.site.com/index.php?params=newthing
Please Help. I tried to see other questions but did not get it!
Here’s an explanation, line by line:
Any URL that matches one of the 3 specified words gets rewritten to go to
gotopage.php.This line is a condition for the next line. Only if the URL matches this regex will the next line even be considered. The regex checks to ascertain that the request is not already going to
gotopage.phporindex.php. If it is, we don’t want to rewrite anything (we would just end up in an infinite loop).If the requested URL has no subsequent slashes, rewrite it to go to
index.php.