- 论坛徽章:
- 0
|
先说一下现象,配置好了apache后, 打算用.htaccess这样先来测试,这样不用每次重启apache, .htaccess文件是生效了,但是, RewriteRule却没有生效(见下面的配置说明), 当我把.htaccess删除后, 还是按.htaccess的规则去rewrite, 这是为什么呢?
操作系统: Debian, Leopard
apahce 2.0
配置文件:
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory /var/www/testcase/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
.htaccess:
RewriteEngine On
RewriteRule ^profile/(\d+) profile.php?id=$1 [L]
在请求 http://localhost/testcase/profile/1的时候, profile.php这个文件确实是被访问到了,也打出了信息, 但是。 id这个参数确怎么也得不到。 而当我把.htaacess删除后, 在请求 http://localhost/testcase/profile/1的时候profile.php仍然被访问到了, 这是什么原因呢?
多谢! |
|