When laravel5 is installed, the. htaccess file in public does not work.

Source: Internet
Author: User
After using composer to download laravel, configure apache. The mod_rewrite module is enabled, and AllowOverrideNone is changed to All. After opening localhost in a browser, the welcome page is not displayed, but the list of three files in public. However, what is written in this tutorial is :...

After using composer to download laravel, configure apache. The mod_rewrite module is enabled, and AllowOverride None is changed to All. After opening localhost in a browser, the welcome page is not displayed, but the list of three files in public.

However, in the tutorial, "Laravel framework does not need index. php In the URL through the public/. htaccess File ".

Solution:
Options + FollowSymLinks
RewriteEngine On

RewriteCond % {REQUEST_FILENAME }! -D
RewriteCond % {REQUEST_FILENAME }! -F
RewriteRule ^ index. php [L]

Adding/overwriting the. htaccess file under the original public is not feasible.

Other information: apache2.4.12/php 5.4.42/laravel5/winxp X86

How can this problem be solved?
Thank you!

Reply content:

After using composer to download laravel, configure apache. The mod_rewrite module is enabled, and AllowOverride None is changed to All. After opening localhost in a browser, the welcome page is not displayed, but the list of three files in public.

However, in the tutorial, "Laravel framework does not need index. php In the URL through the public/. htaccess File ".

Solution:
Options + FollowSymLinks
RewriteEngine On

RewriteCond % {REQUEST_FILENAME }! -D
RewriteCond % {REQUEST_FILENAME }! -F
RewriteRule ^ index. php [L]

Adding/overwriting the. htaccess file under the original public is not feasible.

Other information: apache2.4.12/php 5.4.42/laravel5/winxp X86

How can this problem be solved?
Thank you!

Have you restarted APACHE after configuration change?

Baidu sent a piece of related information saying that the rewrite module of apache was not correctly loaded.
You can perform a test without lavarel,
Write a simple rule to test whether rewrite works normally, and then check other configuration problems.
RewriteRule ^ index. php [L]
This sentence means that any prefix will jump directly to index. php. It should be correct.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.