Advertisement
Guest User

.htaccess

a guest
Jun 2nd, 2014
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.83 KB | None | 0 0
  1. # Redirect Primary Domain URL to Sub-Directory using .htaccess
  2.  
  3. # Do not change this line.
  4. RewriteEngine on
  5.  
  6. # Change domain.com to be your primary main domain.
  7. RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
  8.  
  9. # Change 'subfolder' to be the folder you want to redirect request to.
  10. RewriteCond %{REQUEST_URI} !^/subfolder/
  11.  
  12. # Don't change this line.
  13. RewriteCond %{REQUEST_FILENAME} !-f
  14. RewriteCond %{REQUEST_FILENAME} !-d
  15.  
  16. # Change 'subfolder' to be the folder you want to use for your primary domain.
  17. RewriteRule ^(.*)$ /subfolder/$1
  18.  
  19. # Change domain.com to be your primary domain again.
  20. # Change 'subfolder' to be the folder you will use for your primary domain
  21. # followed by / then the main file for your site, index.php, index.html, etc.
  22. RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
  23. RewriteRule ^(/)?$ subfolder/index.php [L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement