Use the mod_rewrite method under the alias in the wampp environment

Source: Internet
Author: User

When wampp is used to create an alias instance, the mod_rewrite module cannot be used by default.

Some configurations are required:

1. Enable mod_rewrite for wampp

2. Add the following code to the alias configuration file. Modify the code as needed.

The code is as follows: Copy code
Alias/labs/"E:/ecc_ecd_rep/labs_proj/trunk /"
 
<Directory "E:/ecc_ecd_rep/labs_proj/trunk/">
Options Indexes FollowSymLinks
AllowOverride All
Order deny, allow
Allow from all
</Directory>

The key is that AllowOverride All allows the mod_rewrite module.

3. Use RewriteBase in the. htaccess file. Otherwise, rewrite will not take effect.

For example:

The code is as follows: Copy code
RewriteEngine On
 
# Some hosts may require you to use the 'rewritebase 'ctictive.
# If you need to use the 'rewritebase 'ctive VE, it shoshould be
# Absolute physical path to the directory that contains this htaccess file.
#
RewriteBase/labs/jdpat/import/api/
 
RewriteCond % {REQUEST_FILENAME }! -F
RewriteRule ^ index. php [QSA, L]

Add this RewriteBase/labs/jdpat/import/api.

 

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.