Last active
April 2, 2018 22:05
-
-
Save dr-dimitru/7235754 to your computer and use it in GitHub Desktop.
.htaccess file for Laravel 4 and Laravel 3 | For root/ folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# ROOT/ folder .htaccess | |
# ---------------------------------------------------------------------- | |
# Laravel Note: | |
# Note: Laravel is designed to protect your application code, | |
# and local storage by placing only files that are necessarily | |
# public in the public folder. It is recommended that you either | |
# set the public folder as your site's documentRoot (also known as a web root) | |
# or to place the contents of public into your site's root directory | |
# and place all of Laravel's other files outside the web root. | |
# ---------------------------------------------------------------------- | |
# If you have no idea or no possibility to edit server's | |
# settings (for example at shared hosting) - This .htaccess file | |
# will do all work for you. | |
# Just place it into /root folder of your Laravel powered application | |
# ---------------------------------------------------------------------- | |
# This file works with Laravel 3 and 4 | |
# ---------------------------------------------------------------------- | |
# This .htaccess file is recommended | |
# to be placed into /root folder of | |
# your Laravel powered application | |
# ---------------------------------------------------------------------- | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_URI} !^/public/ | |
RewriteCond /public/%{REQUEST_URI} -d | |
RewriteCond %{REQUEST_URI} !(.*)/$ | |
RewriteRule ^(.*)$ /public/$1/ | |
RewriteBase / | |
RewriteCond %{REQUEST_URI} !^/public/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /public/$1 | |
RewriteBase / | |
RewriteRule ^(/)?$ /public/index.php [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Arunmainthan
Yes,
here we put all requests (all URLs) to /public/index.php file.
All URLs which somewhy have
/public/
or/public/index.php
we rewrite to/
, like:mystie.com/public/post/11
will be rewritten tomystic.com/post/11