Skip to content

Commit

Permalink
Try to fix trailing slashes redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels authored Jan 19, 2024
1 parent eb3f55b commit 3b2798e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions public_html/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,22 @@
RewriteRule ^/?fetchfastq(.*)$ /fetchngs$1? [L,R=301]

# Remove trailing slashes from launch and pipeline_schema_builder URLs
RewriteCond %{REQUEST_URI} ^/launch/(.*)
RewriteRule ^(.*)/$ /launch%1 [L]
RewriteCond %{REQUEST_URI} ^/pipeline_schema_builder/(.*)
RewriteRule ^(.*)/$ /pipeline_schema_builder%1 [L]
# RewriteCond %{REQUEST_URI} ^/launch/(.*)
# RewriteRule ^(.*)/$ /launch%1 [L]
# RewriteCond %{REQUEST_URI} ^/pipeline_schema_builder/(.*)
# RewriteRule ^(.*)/$ /pipeline_schema_builder%1 [L]

# Specific convenience URLs
RewriteRule ^/?bilibili/?$ https://space.bilibili.com/1280248035?spm_id_from=333.788.b_765f7570696e666f.1 [R=301,L]

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

# Remove www. from URL
RewriteCond %{HTTP_HOST} ^www.oldsite.nf-co.re$ [NC]
RewriteRule ^(.*)$ https://oldsite.nf-co.re/$1 [L]

# Remove trailing slashes
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)/$ /$1 [L]
RewriteCond %{REQUEST_URI} (.*)/$
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Return join names to join.php
RewriteCond %{REQUEST_URI} ^/join/(.*)$
Expand Down Expand Up @@ -84,3 +80,9 @@
ErrorDocument 404 /404.php

</IfModule>
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^oldsite\.nf\-co\.re$ [OR]
RewriteCond %{HTTP_HOST} ^www\.oldsite\.nf\-co\.re$
RewriteRule ^/?$ "https\:\/\/oldsite\.nf\-co\.re\/" [R=302,L]

0 comments on commit 3b2798e

Please sign in to comment.