Last active
May 12, 2023 09:56
-
-
Save joekolade/a0a7f3ed9806c75c74b08beaf7f55d2d to your computer and use it in GitHub Desktop.
[htaccess] Htaccess things #server
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
# redirect non www to www | |
RewriteCond %{HTTP_HOST} !^(www|dev)\. [NC] | |
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] | |
# Non SSL to SSL | |
RewriteCond %{SERVER_PORT} !^443$ | |
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L] | |
# 301 Redirect only when on a special subdomain/domain | |
RewriteCond %{HTTP_HOST} ^###subdomain###\.###domain###\.###tld###$ [NC] | |
RewriteRule ^/###redirect_source###$ https://###subdomain###.###domain###.###tld###/###redirect_target### [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment