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.