Reputation: 465
I am using following code in Localhost after some some apache settings it is working fine.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
But when I upload this .htaccess file on hosting server then showing error 404. When I check online .htaccess tester it is showing "This variable is not supported: %{REQUEST_FILENAME}"
Upvotes: 1
Views: 56
Reputation: 5081
This should work:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.html [NC,L]
Upvotes: 1