Přeskočit na obsah

Uživatel:Juandev/Wedos .htaccess

Z Wikiverzity

RewriteEngine On

  1. 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]

  1. 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]

  1. aliasy - spravne presmerovani pri chybejicim /

RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]

  1. subdomeny - spravne presmerovani pri chybejicim /

RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^subdom/[^/]+/(.+[^/])$ /$1/ [R]