Last active
March 9, 2024 17:16
-
-
Save shahaj90/a3cda7b69106acb3bb4cdb402ead5366 to your computer and use it in GitHub Desktop.
Nextjs htaccess file for cPanel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
# Remove trailing slash if it exists | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)/$ /$1 [L,R=301] | |
# Serve HTML files without extension | |
RewriteCond %{REQUEST_FILENAME}\.html -f | |
RewriteRule ^(.*)$ $1.html [NC,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment