Created
December 7, 2021 08:58
-
-
Save Michal-Mikolas/acd1413fe659ca64342e595e988e112a 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 | |
RewriteBase / | |
# presmerovani na variantu s www | |
RewriteCond %{HTTP_HOST} ^([^\.]*)\.([^\.]*)$ | |
RewriteRule (.*) http://www.%1.%2/$1 [L,QSA,R=301] | |
# cele domeny (aliasy) | |
RewriteCond %{REQUEST_URI} !^/domains/ | |
#RewriteCond %{HTTP_HOST} ^([^\.]*)\.([^\.]*\.[^\.]*)$ | |
RewriteCond %{HTTP_HOST} ^(.*)\.([^\.]*\.[^\.]*)$ | |
RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d | |
RewriteCond %{DOCUMENT_ROOT}/domains/%2/%1 -d | |
RewriteRule (.*) /domains/%2/%1/$1 [L] | |
# neexistuje subdomena, pak jdi na www | |
RewriteCond %{REQUEST_URI} !^/domains/ | |
RewriteCond %{HTTP_HOST} ^([^\.]*)\.([^\.]*\.[^\.]*)$ | |
RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d | |
RewriteRule (.*) /domains/%2/www/$1 [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment