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]
I have the following link
I like it to appear it as
Can you please provide me the code to be placed in .htaccess file according to the provided link. I have a godaddy hosting.
check your apache config (httpd.conf) see whether it allowing to overriding the htaccess
http://httpd.apache.org/docs/2.0/howto/htaccess.html
If you are doing it in
.htaccess
you should also specifyRewriteBase /
. TryThis rewrites
new-page-something.php
tomypage.php?name=something
internally.ADDED:
Perhaps you want this:
The first added RewriteCond checks whether the real request is requesting for
/mypage.php
to prevent a redirect loop. The second added RewriteCond is used to match the query string for use in RewriteRule.