我想从以下规则中删除网址中的.html,但我收到内部服务器错误
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /folder/index.php?s=$1 [L]
我希望http://localhost/folder/page.html
为http://localhost/folder/page
答案 0 :(得分:1)
试试这个:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.html$ /folder/index.php?s=$1 [L]
</IfModule>