Answered by : topandhi-omega
#Create .htaccess In Laravel Project Root
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> 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
</IfModule>
Source : | Last Update : Fri, 01 Jul 22
Answered by : iyiakod-godlove-abilandou
Rename server.php in your Laravel root folder to index.php
Copy the .htaccess file from /public directory to your Laravel root folder.
Source : | Last Update : Thu, 14 Jan 21
Answered by : shy-salamander-p4rnazlhldut
// Larave remove /public/ from URL
<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Source : https://coderwall.com/p/erbaig/laravel-s-htaccess-to-remove-public-from-url | Last Update : Mon, 08 Nov 21
Answered by : xanthous-xenomorph-uohoc2s5s8v0
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
Source : | Last Update : Thu, 10 Sep 20
Answered by : jealous-jellyfish-605gjrsjcgkf
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]
Source : https://stackoverflow.com/questions/28364496/laravel-5-remove-public-from-url | Last Update : Sat, 06 Jun 20
Answered by : farhad-sahil
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> 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
</IfModule>
Source : https://stackoverflow.com/questions/28364496/laravel-5-remove-public-from-url | Last Update : Wed, 08 Dec 21
Answered by : enchanting-emu-ofn4d0wz1day
<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Source : https://laratutorials.com/laravel-remove-public-from-url/ | Last Update : Sat, 14 May 22
Answered by : shafeeque-ahmad
don't remove your server.php into index.php in root
file you should place following inside .htacess file in root
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
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php80” package as the default “PHP” programming language.
<IfModule mime_module> AddHandler application/x-httpd-ea-php80 .php .php8 .phtml
</IfModule>
Source : https://stackoverflow.com/questions/28364496/laravel-5-remove-public-from-url | Last Update : Thu, 20 Jan 22
Answered by : usama-ashraf
//Laravel 9 Just Add these code in .htaccess file
RewriteCond %{REQUEST_URI} !^/public($|/)
RewriteRule ^(.*)$ public/$1 [L]
Source : | Last Update : Tue, 06 Sep 22