Created
July 19, 2024 15:41
-
-
Save jc3lee/45196e6a81e66bcc8dd9a3cc4d116afa to your computer and use it in GitHub Desktop.
.htaccess code for NextJS build exported to traditional server with Apache system
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
| # For NextJS build exported to traditional server with Apache system | |
| # To make pages links work without needing to add ".html" to the href | |
| RewriteBase / | |
| # Add .html to URLs without it, except for the root URL | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_URI} !^/$ | |
| RewriteRule ^(.*)$ $1.html [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment