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