I have this simple redirection on my website and it does not rewrite my url automatically, I have to type manual other URL to access it, what could be the problem, do I need to have something enabled in php.ini, below is the rewrite rule
RewriteEngine On
RewriteRule ^new-page-([^/]*)\.php$ /mypage.php?name=$1 [L]
If you are doing it in
.htaccessyou should also specifyRewriteBase /.Try
This rewrites
new-page-something.phptomypage.php?name=somethinginternally.ADDED:
Perhaps you want this:
The first added RewriteCond checks whether the real request is requesting for
/mypage.phpto prevent a redirect loop.The second added RewriteCond is used to match the query string for use in RewriteRule.