Skip to content

Instantly share code, notes, and snippets.

@aabir
Created November 8, 2015 06:33
Show Gist options
  • Save aabir/1d9184f84cfd785a7402 to your computer and use it in GitHub Desktop.
Save aabir/1d9184f84cfd785a7402 to your computer and use it in GitHub Desktop.
Laravel 5, to remove public folder from localhost; rename the server.php file to index.php and bring the .htaccess file to root and add following line.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment