相关疑难解决方法(0)

Mod_Rewrite意外行为L标志

我的Web应用程序结构是:

/var/www/myapp/
    - www/
        - index.php
        - css.php
        - .htaccess
Run Code Online (Sandbox Code Playgroud)

虚拟主机配置为:

<VirtualHost *:80>
        ServerName www.example.org
        DocumentRoot /var/www/myapp/www
        DirectoryIndex index.php index.html
        <Directory /var/www/myapp/www>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

在/var/www/myapp/www/.htaccess中有:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteRule css css.php [L,NC]
    RewriteRule .* index.php
</IfModule>
Run Code Online (Sandbox Code Playgroud)

现在,如果我打电话给www.example.org,我正确地重定向到index.php,但是如果我打电话给www.example.org/css,我仍然会被重定向到index.php.

如果我删除"RewriteRule.*index.php"行,然后调用www.example.org/css,我正确地重定向到css.php.

怎么了?非常感谢

========编辑=========

192.168.1.8 - - [14/Jul/2012:19:07:21 +0200] [www.example.org/sid#b747b6c0][rid#b7080058/initial] (3) [perdir /var/www/sviluppo/mattia_dev/example/www/] add path info postfix: /var/www/sviluppo/mattia_dev/example/www/DEV_2 -> /var/www/sviluppo/mattia_dev/example/www/DEV_2/css/example1/test.css
192.168.1.8 - - [14/Jul/2012:19:07:21 +0200] [www.example.org/sid#b747b6c0][rid#b7080058/initial] (3) [perdir /var/www/sviluppo/mattia_dev/example/www/] strip …
Run Code Online (Sandbox Code Playgroud)

apache mod-rewrite

9
推荐指数
1
解决办法
7355
查看次数

标签 统计

apache ×1

mod-rewrite ×1