Apache uses. htaccess to cause 500 errors

Source: Internet
Author: User

A environment pache+mysql+php, everything is normal. Upload, 500 error has occurred. The reason for this investigation:

Then, you see a. htaccess file under the root of the Web site, and then think about whether this file is causing it, rename it first. Open the site again, you can access the normal, but the previous pseudo-static page, will not be displayed.

Find out where the problem lies, and solve it. It appears that Apache is not supported after the default loading. htaccess, then start modifying the httpd.conf file

First, find

#LoadModule Rewrite_module modules/mod_rewrite.so

Turn the #去掉 of the front into

LoadModule Rewrite_module modules/mod_rewrite.so

Then find allowoverride None

Change it to allowoverride all

Finally, save the httpd.conf file, and restart the Apache service, open the website again, everything is OK.

In Baidu and Gu brother looked for a lot of methods, now a simple list, right when the reference bar.

Method One (unsuccessful):
Open the. htaccess, comment out the options +followsymlinks, # Options +followsymlinks, because http.conf is there;
Open http.conf, put this sentence loadmodule Rewrite_module modules/mod_rewrite.so before the comment symbol went.

Method Two (unsuccessful):
To remove the #rewritebase/htaccess in.

Method Three (unsuccessful):
There are a lot of people who say that it is file permissions problem,. htaccess syntax is incorrect. I didn't show up here.

Final Solution:
I looked at myself Apache config file is suddenly see LoadModule rewrite_module modules/mod_rewrite.so, his Apache is not open mod_rewrite?
Ubuntu executes the sudo a2enmod rewrite command. Then restart Apache:sudo/etc/init.d/apache2 restart.

OK, did not think the problem so simple, hey, white circle.

Apache uses. htaccess to cause 500 errors

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.