Reputation:
I have issue on url rewrite i am want to change url
http://www.example.com/mbl.php?domain=example.com to http://www.example.com/mbl/example.com
So i have written code myself by as below
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^/mbl/([^/]+)$ /mbl.php?domain=$1
But its not working. so please to my error.
Thanks
Upvotes: 1
Views: 26
Reputation: 24478
You should try your rules this way and remove the leading slash from the rewriterule with mbl
since you are using it in .htaccess file.
Give these rules a try.
#Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^mbl/([^/]+)$ /mbl.php?domain=$1 [L]
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Upvotes: 1