Skip to content

Commit

Permalink
Put stuff back but remove the 301 codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels authored and mashehu committed Aug 7, 2023
1 parent e4b5e74 commit da75b6a
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions public_html/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,17 @@
RewriteRule ^/?bilibili/?$ https://space.bilibili.com/1280248035?spm_id_from=333.788.b_765f7570696e666f.1 [R=301,L]

# Redirect http to https
# Commented out to avoid Netlify proxy issues
# RewriteCond %{HTTP_HOST} ^nf-co\.re [NC]
# RewriteCond %{SERVER_PORT} 80
# RewriteRule ^(.*)$ https://nf-co.re/$1 [R,L]
RewriteCond %{HTTP_HOST} ^nf-co\.re [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://nf-co.re/$1 [R,L]

# Remove www. from URL
# Commented out to avoid Netlify proxy issues
# RewriteCond %{HTTP_HOST} ^www.nf-co.re$ [NC]
# RewriteRule ^(.*)$ https://nf-co.re/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.nf-co.re$ [NC]
RewriteRule ^(.*)$ https://nf-co.re/$1 [L]

# Remove trailing slashes
# Commented out to avoid Netlify proxy issues
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule (.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)/$ /$1 [L]

# Return join names to join.php
RewriteCond %{REQUEST_URI} ^/join/(.*)$
Expand All @@ -48,9 +45,8 @@
RewriteRule ^(.*)$ /logo.php?t=$1 [L,NC,QSA]

# Remove double-slashes
# Commented out to avoid Netlify proxy issues
# RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
# RewriteRule (.*) %1/%2 [R=301,L]
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
RewriteRule (.*) %1/%2 [L]

# Run PHP without filename extension
RewriteCond %{REQUEST_FILENAME} !-d
Expand All @@ -59,15 +55,15 @@

# Remove trailing /index from URL
RewriteCond %{REQUEST_URI} ^(.*)/index$
RewriteRule (.*) %1 [R=301,L]
RewriteRule (.*) %1 [L]

# Remove trailing /README from URL
RewriteCond %{REQUEST_URI} ^(.*)/README$
RewriteRule (.*) %1 [R=301,L]
RewriteRule (.*) %1 [L]

# Redirect .md URLs to remove the extension
RewriteCond %{REQUEST_URI} ^(.*)\.md$
RewriteRule (.*) %1 [R=301,L]
RewriteRule (.*) %1 [L]

# Return 404 if original request is .php
RewriteCond %{THE_REQUEST} \.php[/\s?] [NC]
Expand Down

0 comments on commit da75b6a

Please sign in to comment.