Skip to content

Instantly share code, notes, and snippets.

@stevecyj
Created August 20, 2021 07:10
Show Gist options
  • Select an option

  • Save stevecyj/2eafa44381edcaab5f9020f80b6d1146 to your computer and use it in GitHub Desktop.

Select an option

Save stevecyj/2eafa44381edcaab5f9020f80b6d1146 to your computer and use it in GitHub Desktop.
laravel remove public from url
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment