ken*_*xit 5 php apache .htaccess
我使用XAMPP和.htaccess文件在localhost上有PHP项目:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /locations/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /test.php [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)
但这不起作用,我只得到错误404.在httpd.conf文件中,我已取消注释这一行:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
Run Code Online (Sandbox Code Playgroud)
我使用的是Windows 8.1.我能做些什么才能让它发挥作用呢?
您可以在root .htaccess中使用此规则:
RewriteEngine On
RewriteBase /
RewriteRule ^locations(/.*)?$ test.php [L,NC]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11273 次 |
| 最近记录: |