Last active
October 8, 2018 01:50
-
-
Save damncabbage/3a5db42a0218b396d2c654782e9a2607 to your computer and use it in GitHub Desktop.
This file contains 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
RewriteEngine on | |
# Manual rewrites; see ###s below. | |
RewriteRule questions/ questions.php [NC,L] | |
RewriteRule questions questions.php [NC,L] | |
RewriteRule episodes/ episodes.html [NC,L] | |
RewriteRule episodes episodes.html [NC,L] | |
RewriteRule links/ links.html [NC,L] | |
RewriteRule links links.html [NC,L] | |
# Add trailing slash to url | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$ | |
RewriteRule ^(.*)$ $1/ [R=301,L] | |
### Things that were tried locally on Apache 2.4 and yet | |
### don't work on Gandi for unknown reasons: | |
## Rewrite *.php to * | |
#RewriteCond %{REQUEST_FILENAME} !-d | |
#RewriteCond %{REQUEST_FILENAME} !-f | |
#RewriteCond %{REQUEST_FILENAME}.php –f | |
#RewriteRule ^(.*)$ $1.php [NC,L] | |
## Rewrite *.html to * | |
#RewriteCond %{REQUEST_FILENAME} !-d | |
#RewriteCond %{REQUEST_FILENAME} !-f | |
#RewriteCond %{REQUEST_FILENAME}.html –f | |
#RewriteRule ^(.*)$ $1.html [NC,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment