I want to remove .html from url. For this i am trying following. But not sure what is wrong, not working in my case.
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.*).html\ HTTP/
RewriteRule .* http://localhost/demo/blog/test.html%1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.*)\ HTTP/
RewriteRule .* %1.html [L]
I want to remove .html from this URL http://localhost/demo/blog/test.html.
So if someone enter this URL, .html should be removed from URL by htaccess
http://localhost/demo/blog/test/.
And need to add this rules only for blog directory.
I hope someone help me.
/demo/blog/but your code is expecting/html/- is this the actual code you are using?