steamboy
steamboy

Reputation: 1162

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

Upvotes: 0

Views: 292

Answers (1)

pixeline
pixeline

Reputation: 17984

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>

Upvotes: 1

Related Questions