Advertisement
Guest User

Wedos

a guest
Jul 15th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. # htaccess rules for subdomains and aliases
  2. # to create new subdomain, create a folder www/subdom/(subdomain name)
  3. # to create web for alias, create a folder www/domains/(whole domain name)
  4.  
  5. # htaccess pravidla pro subdomeny a samostatne weby aliasu
  6. # pro vytvoreni subdomeny vytvorte adresar www/subdom/(nazev subdomeny)
  7. # pro vytvoreni webu pro alias vytvorte adresar www/domains/(cely domenovy nazev)
  8. # dalsi info a priklady: http://kb.wedos.com/r/32/webhosting-htaccess.html
  9.  
  10. RewriteEngine On
  11.  
  12. # cele domeny (aliasy)
  13. RewriteCond %{REQUEST_URI} !^domains/
  14. RewriteCond %{REQUEST_URI} !^/domains/
  15. RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
  16. RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d
  17. RewriteRule (.*) domains/%2/$1 [DPI]
  18. RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
  19. RewriteCond %{REQUEST_FILENAME} -d [NC]
  20. RewriteRule .* - [L]
  21. RewriteRule ^([\w-]+)$ /$1.html [L,QSA]
  22.  
  23. # subdomeny (s nebo bez www na zacatku)
  24. RewriteCond %{REQUEST_URI} !^subdom/
  25. RewriteCond %{REQUEST_URI} !^/subdom/
  26. RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
  27. RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d
  28. RewriteRule (.*) subdom/%2/$1 [DPI]
  29.  
  30. # aliasy - spravne presmerovani pri chybejicim /
  31. RewriteCond %{REQUEST_FILENAME} -d
  32. RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]
  33.  
  34. # subdomeny - spravne presmerovani pri chybejicim /
  35. RewriteCond %{REQUEST_FILENAME} -d
  36. RewriteRule ^subdom/[^/]+/(.+[^/])$ /$1/ [R]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement