S
S
Stanislav Pochepko2015-12-01 13:11:31
htaccess
Stanislav Pochepko, 2015-12-01 13:11:31

How to configure .htaccess for laravel if it's in a subfolder?

The project is deployed on the hosting in the subfolder example.com/folder
How to write in .htaccess that he would remove public from the URL, but also take into account that it is in a subfolder?
Also index.php in public doesn't want to run by default.
Now at the root of example.com/folder is .htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

and in the folder example.com/folder/public
<IfModule mod_rewrite.c>
    Options +FollowSymLinks
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^ index.php [L]
</IfModule>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question