I'm new to Laravel and trying to figure out this situation. I have a Laravel 5 app. And now I have to run same application with some changes into its Sub Directory. So what I've done is, I've duplicated the application into v2 Sub Directory as follows:
.htacceess at both roots of Main Application and v2 Application:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /
# Send requests to public directory...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ public/index.php [L]
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
</IfModule>
<IfModule security2_module>
SecRuleRemoveByTag unoeuro
</IfModule>
.htacceess at v2 Application public folder:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteBase /v2/
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
And this is the result when I access v2 Application via http://localhost:8000/v2:
I have tried so many ways but failed. Any help will be really appreciated! Thanks.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2ZXOZX8
via IFTTT


Aucun commentaire:
Enregistrer un commentaire