0

I want to use a path / directly in the Laravel project, but without changing the path, I want to leave the project as it is, not to change the location of public files, and I tried to do this via .htaccess, but did not work in localhost :(

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

But nothing changed, it did not work ... and the default path remained /public

Saif Manwill
  • 692
  • 1
  • 9
  • 20

1 Answers1

1

Options -MultiViews

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1 

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php