I have the following url:
http://www.mysite.com/blog.php
and I want it to rewrite to:
http://www.mysite.com/index.php?goto=blog
How to do this in Apache2?
I've seen many examples of doing it the other way around...
Many thanks in advance,
I have the following url:
http://www.mysite.com/blog.php
and I want it to rewrite to:
http://www.mysite.com/index.php?goto=blog
How to do this in Apache2?
I've seen many examples of doing it the other way around...
Many thanks in advance,
If you want to rewrite all .php to index, you should do:
RewriteRule ^(.*).php$ index.php?goto=$1 [L,QSA]
if you would like to rewrite only some files:
RewriteRule ^(blog.php|other_file.php)/(.*)?$ index.php?goto=$1/$2 [L,QSA]
Try this (untested):
^/(.*)\.php$ /index.php?goto=$1
This should work even with other pages, not only with the blog.php. Have a look at the documentation.