Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 0.50 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. subdomains dynamically htacces
  2. # if requested subdomain is not "www"
  3. RewriteCond %{REQUEST_FILENAME} !-f
  4. RewriteCond %{HTTP_HOST} !^(www.)?example.com [NC]
  5. # and we have not already rewritten this request to the subdomain's subfolder
  6. #RewriteCond %{THE_REQUEST} !/folder/.
  7.  
  8. # extract requested subdomain to %2
  9. RewriteCond %{HTTP_HOST} ^(www.)?([^.]+).example.com
  10. # rewrite the request to the subdomain's subfolder
  11. RewriteRule ^([^/]*) folder1/folder2/index.php?var=%2 [L]
  12.        
  13. RewriteCond %{REQUEST_FILENAME} !-f