Configuration method for using. htaccess URL rewriting in Windows Apache

Source: Internet
Author: User

Step 1: Find the Apache configuration file httpd. conf (the file is in the conf directory)

Step 2: First, you must allow the server to support mod_rewrite. If you are using a virtual host, ask your host provider in advance.

 

Open httpd. conf and find

 

# Loadmodule rewrite_module modules/mod_rewrite.so

 

Remove #

 

Change AllowOverride none to AllowOverride all,

 

NOTE: If AllowOverride is set to all, URL rule rewriting is supported on the entire server. The Apache server needs to read the. htaccess file under the directory of each website. Without this file, or the document does not define any URL rewriting rules, it will not have any effect.

 

For different URLs, add the following content to Apache:

 

<Directory "E:/Apache Group/apache2/htdocs/leapsoul">

 

/* The quotation marks indicate your web storage directory */

 

/* For Linux, you can locate your website directory */

Options followsymlinks

AllowOverride none

 

</Directory>

 

Step 3: restart the Apache server and press stop before start.

 

Step 4: place a. htaccess file in the website directory where you need to rewrite the URL. The file name is. htaccess, and cannot be directly created under windiws. You can save it as Notepad.

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.