Skip to content

Instantly share code, notes, and snippets.

@Domm98CZ
Last active March 21, 2021 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Domm98CZ/7fba08e6693e3dd1dc05860929873c80 to your computer and use it in GitHub Desktop.
Save Domm98CZ/7fba08e6693e3dd1dc05860929873c80 to your computer and use it in GitHub Desktop.
wedos main htaccess
RewriteEngine On
ErrorDocument 500 "500 - Vnitrni chyba!"
ErrorDocument 404 "404 - Stranka nenalezena!"
ErrorDocument 401 "Litujeme, ale nemate pravo k pristupu k tomuto souboru!"
ErrorDocument 403 "Litujeme, ale nemate pravo k pristupu k tomuto souboru!"
# cele domeny (aliasy)
RewriteCond %{REQUEST_URI} !^domains/
RewriteCond %{REQUEST_URI} !^/domains/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d
RewriteRule (.*) domains/%2/$1 [DPI]
# subdomeny (s nebo bez www na zacatku)
RewriteCond %{REQUEST_URI} !^subdom/
RewriteCond %{REQUEST_URI} !^/subdom/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d
RewriteRule (.*) subdom/%2/$1 [DPI]
# aliasy - spravne presmerovani pri chybejicim /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]
# subdomeny - spravne presmerovani pri chybejicim /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^subdom/[^/]+/(.+[^/])$ /$1/ [R]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment