code_junkie

Apache .htaccess mod_rewrite and clean urls

Nov 12th, 2011
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On
  3.  
  4. RewriteCond %{REQUEST_FILENAME} !-f
  5. RewriteCond %{REQUEST_FILENAME} !-d
  6. RewriteCond %{REQUEST_URI} ^/domain1.com/(.*)$
  7. RewriteRule ^(.*)$ /domain1.com/index.php?q=$1 [L,QSA]
  8.  
  9. RewriteCond %{REQUEST_FILENAME} !-f
  10. RewriteCond %{REQUEST_FILENAME} !-d
  11. RewriteCond %{REQUEST_URI} ^/domain2.com/(.*)$
  12. RewriteRule ^(.*)$ /domain2.com/index.php?q=$1 [L,QSA]
  13. </IfModule>
  14.  
  15. RewriteCond %{REQUEST_FILENAME} !-f
  16. RewriteCond %{REQUEST_FILENAME} !-d
  17. RewriteRule ^/domain1.com/(.*)$ /domain1.com/index.php?q=$1 [L,QSA]
  18. # ^ should be escaped
Add Comment
Please, Sign In to add comment