Skip to content

Instantly share code, notes, and snippets.

@huzaifaarain
Created May 19, 2021 11:16
Show Gist options
  • Save huzaifaarain/c9677d9385bbcc9b40939248e77c5342 to your computer and use it in GitHub Desktop.
Save huzaifaarain/c9677d9385bbcc9b40939248e77c5342 to your computer and use it in GitHub Desktop.
Remove public from URL Laravel 7.x including sub directory
<IfModule mod_rewrite.c>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment