Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # htaccess rules for subdomains and aliases
- # to create new subdomain, create a folder www/subdom/(subdomain name)
- # to create web for alias, create a folder www/domains/(whole domain name)
- # htaccess pravidla pro subdomeny a samostatne weby aliasu
- # pro vytvoreni subdomeny vytvorte adresar www/subdom/(nazev subdomeny)
- # pro vytvoreni webu pro alias vytvorte adresar www/domains/(cely domenovy nazev)
- # dalsi info a priklady: http://kb.wedos.com/r/32/webhosting-htaccess.html
- RewriteEngine On
- # 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]
Add Comment
Please, Sign In to add comment