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

Untitled

By: a guest on Apr 16th, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 12  |  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. RewriteEngine On
  2. RewriteBase /
  3.  
  4. # redirects subX.subY.domain.com to /-client/subY/subX
  5. RewriteCond %{REQUEST_URI} !^/-
  6. RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.([^\.]+)
  7. RewriteCond %{DOCUMENT_ROOT}/-clients/%3/%2 -d
  8. RewriteRule ^(.*)$ -clients/%3/%2/$1 [L]
  9.  
  10. # redirects subY.domain.com to /-client/subY/
  11. RewriteCond %{REQUEST_URI} !^/-
  12. RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)
  13. RewriteCond %{DOCUMENT_ROOT}/-clients/%2 -d
  14. RewriteRule ^(.*)$ -clients/%2/$1 [L]