I am using a Virtual Host for my Laravel 4 Project on my local host to get rid off typing 'localhost/L4/public/index.php/route'. Laravel also uses a .htaccess file in it's public directory. Both the Virtual Host and .htaccess files are given below:
Virtual Host File
<VirtualHost *:80>
ServerAdmin admin@mail.com
DocumentRoot /var/www/L4/public
ServerName www.L4.dev
Alias /billing /var/www/L5/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/L4/public/>
AllowOverride All
</Directory>
</VirtualHost>
.htaccess File for Laravel 4 Project
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Suppose Laravel 4 project has a route 'route1'. This Virtual Host file and .htaccess file let me allow to access my Laravel 4 project's 'route1' using "www.L4.dev/index.php/route1".
I added the following in my Virtual Host file to get rid off 'index.php' from the above given address:
<Directory /var/www/L4/public/>
AllowOverride All
</Directory>
This works fine and now I can access the my 'route1' route of Laravel 4 project using 'www.L4.dev/route1'.
But notice I'm also using an Alias '/billing' in my Virtual Host file to access another project L5 (laravel 5 project).
Now suppose this Laravel 5 project has a route 'route2' and to access this route I've to type 'www.L4.dev/billing/index.php/route2'.
I also want to get rid off 'index.php' from here as well but don't know how to do so???
I'm sure that I've to do some thing with this Virtual Host file and with the .htaccess file in 'pbulic' directory of L5 but don't know what and how to do?
Note: There is no Virtual Host file for Laravel 5 project, just Alias is getting used to access it.
.htacess file in 'L5/Public/' Directory
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Can some one pleas help me in this regard ????