I'm working on a Laravel project. I'm Removing "/public" from URL but it's only work on welcome page, other page like /login,/register is doesn't work properly. it's shows an error.
The requested URL /GME/login was not found on this server.
Apache/2.4.18 (Ubuntu) Server at localhost Port 80
but when I use public/index.php in URL it's working.
Here, is my root .htaccess file code.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public/
RewriteRule ^(.*)$ public/$1 [L] #relative substitution
RewriteRule ^ index.php
and here is my /public/.htaccess file code.
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

laravelproject folder structure. - Gabrielle-MDOCUMENT_ROOT? Is it thepublicfolder? or the root of the laravel project? Your document root should be thepublicfolder. - Sakibul Alam