SHARE
TWEET

Ako vytvoriť subdoménu na webhostingu Wedos

PATWIST Apr 28th, 2019 36 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
  19. # subdomeny (s nebo bez www na zacatku)
  20. RewriteCond %{REQUEST_URI} !^subdom/
  21. RewriteCond %{REQUEST_URI} !^/subdom/
  22. RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
  23. RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d
  24. RewriteRule (.*) subdom/%2/$1 [DPI]
  25.  
  26. # aliasy - spravne presmerovani pri chybejicim /
  27. RewriteCond %{REQUEST_FILENAME} -d
  28. RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]
  29.  
  30. # subdomeny - spravne presmerovani pri chybejicim /
  31. RewriteCond %{REQUEST_FILENAME} -d
  32. RewriteRule ^subdom/[^/]+/(.+[^/])$ /$1/ [R]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top