简体   繁体   中英

Apache rewrite url with Laravel 5 How to remove /public/index.php in the url

The apache root Document is ~/Sites/ .

My laravel project is called laravelTest in the ~/Sites/laravelTest

The index url is http://localhost/laravel/public/index.php

And restful url is http://localhost/laravel/public/index.php/ $1/$2 ...

How can I remove the /public/index.php?

How do I setting the .htaccess file...

I only can remove the index.php ,but can't remove the /public/

Thanks.

There are many solutions for removing the index.php in Laravel 4,5 to remove public/index.php from URL

I would recommend you this simple step

  1. Rename the file server.php in the your Laravel root folder to index.php

  2. Move the .htaccess file from /public directory to your Laravel root folder.

Ref : As simple like this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM