So, I\'m running xampp on Windows. I\'m currently trying to get familiar with the laravel framework. Now, when thats pointed out. How can i be able to access my laravel appl
if you remove public from url first of all move index.php and .htaccess file from public folder to root of the laravel and change in index.php file
require DIR.'/../bootstrap/autoload.php'; $app = require_once DIR.'/../bootstrap/start.php';
to
require DIR.'/bootstrap/autoload.php'; $app = require_once DIR.'/bootstrap/start.php';
and run the program
Move the contents of the /public folder down a level.
You'll need to update the include lines in index.php to point to the correct location. (if it's down a level, remove the '../').
If you don't wish to go through the stress of configuring .htaccess file, you could use PHP Built-in Server by doing this:
laravel\public
php -S localhost:8000
After you can access your website by going to:
http:://localhost:8000
works without appending public
See the official manual to learn more: http://php.net/manual/en/features.commandline.webserver.php
You can use symlinks or edit the httpd.conf
file.
Check my answer to another similar question. I hope that it helps.
Add following code in your .htaccess (if not exist create a .htaccess on laravel root directory)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Source : http://tutsnare.com/remove-public-from-url-laravel/
at Source you also get another method to do same.
Update : Preferred way to do it is make change in directory structure which explain in source URL.
Easiest way is create .htaccess
file in your Laravel root with following content:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
It should be redirected easily.
Reference: https://coderwall.com/p/erbaig/laravel-s-htaccess-to-remove-public-from-url