开发者

Removing .html on RewriteRule does not work

开发者 https://www.devze.com 2023-03-13 02:43 出处:网络
I want to remove the .html from the URL from the rule below but I get a开发者_如何学运维 Internal Server Error

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号