0

i want to redirect my query base url to pretty url,i am trying this on local host, i want if any one try to access http://localhost/something/index.php?page=zen it will redirect to http://localhost/something/zen.html,
ie
http://localhost/something/index.php?page=zen => http://localhost/something/zen.html

RewriteEngine On
RewriteCond %{REQUEST_URI}  ^/index\.php$
RewriteCond %{QUERY_STRING} ^page=([a-zA-Z0-9_-])$
RewriteRule ^(.*)$ http://localhost/cmsmadesimple/%1.html [L,R=301]
3
Contributors
9
Replies
25
Views
4 Years
Discussion Span
Last Post by ak47carbon
0

Which page is the real one (that does processing)? The php or the html one? If the real one is the php one, then you're doing this backwards.

0

To clarify, are you trying to rewrite a pretty URL i.e. website.com/page to a non pretty url i.e. website.com/index.php?page=page or are you trying to disallow a user from visiting a non-pretty URL by trying to redirect them back to the relevant pretty one?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.