Skip to content

Instantly share code, notes, and snippets.

@Xatta-Trone
Created October 1, 2019 17:16
Show Gist options
  • Save Xatta-Trone/1f0845cc1eb8fd5fb48b4333384acf0e to your computer and use it in GitHub Desktop.
Save Xatta-Trone/1f0845cc1eb8fd5fb48b4333384acf0e to your computer and use it in GitHub Desktop.

Revisions

  1. Xatta-Trone created this gist Oct 1, 2019.
    18 changes: 18 additions & 0 deletions remove_public_from_laravel.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    <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>