Enable Mod Rewrite and. htaccess in Apache

Source: Internet
Author: User

In Windows, we generally use the Administrator account, so enabling these two items is very simple:

1. Find # LoadModule rewrite_module modules/mod_rewrite.so in the [Apache installation directory]/conf/httpd. conf and remove the annotator #. If this row does not exist, add it. Check whether the mod_rewrite.so file exists in the modules folder under the apache installation directory. In this way, the Mod Rewrite function is enabled.
2. In the [Apache installation directory]/conf/httpd. conf, find

The code is as follows: Copy code
<Directory/>
Options FollowSymLinks
AllowOverride None
Order deny, allow
Deny from all
</Directory>

Change "AllowOverride None" to "AllowOverride All", so that All folders are supported. htaccess or enabled for the specified folder. htaccess, which can be found in the [Apache installation directory]/conf/httpd. add in conf

The code is as follows: Copy code

<Directory "D:/sites/example/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow, deny
Allow from all
</Directory>

This approach is generally configured with the virtual host, so most will write the above configuration code into the [Apache installation directory]/conf/extra/httpd-vhost.conf, which is clear and easy to manage.

3. After restarting Apache, it will be OK.

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.