Last active
August 29, 2015 14:22
-
-
Save MnMTech/37bc460d26d99ae91109 to your computer and use it in GitHub Desktop.
.htaccess file to redirect traffic from web root into Laravel project sub directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
RewriteEngine On | |
# remove www | |
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] | |
RewriteRule ^ http://%1%{REQUEST_URI} [NE,R=301,L] | |
RewriteCond %{HTTP_HOST} ^(www\.)?hostname\.com$ | |
RewriteRule !^projectname/public/ /projectname/public%{REQUEST_URI} [L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment