Removing .html on RewriteRule does not work
I want to remove the .html from the URL from the rule below but I get a开发者_如何学运维 Internal Server Error
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /folder/index.php?s=$1 [L]
I want http://localhost/folder/page.html
to be http://localhost/folder/page
Try this:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.html$ /folder/index.php?s=$1 [L]
</IfModule>
精彩评论