0

I wanted to isntall laravel in a sub directory inside my dev machine http://dev-machine/applis/main/laravel

My default document root is F:/data/web

My .htaccess file is

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /applis/main/laravel
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

</IfModule>

My httpd.conf file has below code

<VirtualHost *:80>
  ServerName http://dev-machine/applis/main/laravel/public
  DocumentRoot F:/data/web/applis/main/laravel/public
  <Directory "applis/main/laravel/public">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>

I have also tried the belwo virtual host config

<VirtualHost *:80>
  ServerName http://dev-machine/applis/main/laravel/public
  Alias /laravel applis/main/laravel/public
  DocumentRoot F:/data/web/applis/main/laravel/public
  <Directory "/applis/main/laravel/public">
    AllowOverride all
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

But stil I am unable to access the app via

http://dev-machine/applis/main/laravel/public

I am getting he below error

Not Found

The requested URL /applis/main/laravel/public/ was not found on this server.

After adding the virtual host when it is not even loading the index.php file when I try loading it directly via http://dev-machine/applis/main/laravel/public/index.php

karthi
  • 5
  • 4
  • Have you updated your host file? – Kamal Joshi Jan 06 '16 at 13:03
  • Yes, I have. and still it is the same. :-( – karthi Jan 06 '16 at 14:00
  • I edited my Document root to /applis/main/laravel/public removing the F:/applis/main and nwo I am getting the error that says access is Forbidden, please help – karthi Jan 06 '16 at 15:13
  • Is there any laravel setup in F:/data/web? or do you have any .htaccess file in F:/data/web? – Kamal Joshi Jan 06 '16 at 15:29
  • Can you try adding like as shown in virtualhost and restart your local server? [Note down full path in directory] ServerName http://dev-machine/applis/main/laravel/public DocumentRoot F:/data/web/applis/main/laravel/public Options Indexes FollowSymLinks AllowOverride All Require all granted – Kamal Joshi Jan 06 '16 at 15:34
  • Laravel instalation is inside Laravel folder in F:\data\web\applis\main\laravel and not in the F:/data/web... and I have the .htaccess file inside public directory fo the laravel folder – karthi Jan 06 '16 at 16:08
  • On changing it and restarting the server, I got Internal server error, then on checking the logs I have the below `Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.` – karthi Jan 06 '16 at 16:15
  • Can you please paste the .htaccess file content in question or http://stackoverflow.com/questions/15850845/request-exceeded-the-limit-of-10-internal-redirects-due-to-probable-configuratio might this be useful to you.. – Kamal Joshi Jan 07 '16 at 05:30
  • ` Options -MultiViews 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] ` – karthi Jan 07 '16 at 11:33
  • I think it is working now, THanks for the help – karthi Jan 07 '16 at 11:34
  • Please share your answer with community.. – Kamal Joshi Jan 07 '16 at 12:28
  • I have to use the ocrrect virtual host setting that you asked me to use.` ServerName dev-machine/applis/main/laravel/public DocumentRoot F:/data/web/applis/main/laravel/public Options Indexes FollowSymLinks AllowOverride All Require all granted ` Then restarted the server and all is fine. – karthi Jan 07 '16 at 15:07

0 Answers0