Laravel remove public from url
23.Dec.2019
When you setup a new laravel website you want to get rid of that “/public” in the url. Here is a direct code which you can paste into .htaccess file of root to remove that annoying “public”
<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>
Or if you have domain access then you can just point your domain to public folder directly.
Leave a Reply
We'll try to resolve your queries asap.
Recent Posts
22.Jan.2024 | codedrill | Drupal
Drupal 7 to 10 migration services
Hire Codedrill for Drupal 7 to Drupal 10 migration. We also offer complete drupal development services from
11.Jan.2024 | codedrill | Apache, Hosting, Linux, MySQL, PHP
Install php 8.2, mysql, apache, phpmyadmin on ubuntu 22
All the new CMS and frameworks have started support for php 8.2. And it is quite easy to install php8.2 on