Guest User

Untitled

a guest
Sep 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. # If the request is not for the the main domain or the www subdomain
  2. rewriteCond %{HTTP_HOST} !^(www\.)?foo\.com
  3. # get the requested subdomain name into variable %2
  4. rewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.foo\.com
  5. # and if not already rewritten to subdomain's subdirectory
  6. rewriteCond $1 !^subdomains/
  7. # internally rewrite to prefix "/subdomains/<subdomain-name>/" to the client-requested URL-path
  8. rewriteRule ^(.*)$ /subdomains/%2/$1 [L]
Add Comment
Please, Sign In to add comment