selimppc

.htaccess main domain to subdirectory redirect

Feb 1st, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.87 KB | None | 0 0
  1. # .htaccess main domain to subdirectory redirect
  2.  
  3. # Do not change this line.
  4.  
  5. RewriteEngine on
  6.  
  7. # Change example.com to be your main domain.
  8.  
  9. RewriteCond %{HTTP_HOST} ^(www.)?asimstoys.com.au$
  10.  
  11. # Change ‘subdirectory’ to be the directory you will use for your main domain.
  12.  
  13. RewriteCond %{REQUEST_URI} !^/public/
  14.  
  15. # Don’t change the following two lines.
  16.  
  17. RewriteCond %{REQUEST_FILENAME} !-f
  18.  
  19. RewriteCond %{REQUEST_FILENAME} !-d
  20.  
  21. # Change ‘subdirectory’ to be the directory you will use for your main domain.
  22.  
  23. RewriteRule ^(.*)$ /public/$1
  24.  
  25. # Change example.com to be your main domain again.
  26.  
  27. # Change ‘subdirectory’ to be the directory you will use for your main domain
  28.  
  29. # followed by / then the main file for your site, index.php, index.html, etc.
  30.  
  31. RewriteCond %{HTTP_HOST} ^(www.)?asimstoys.com.au$
  32.  
  33. RewriteRule ^(/)?$ public/index.php [L]
Advertisement
Add Comment
Please, Sign In to add comment