我试图让我非常简单的重写规则工作。我正在尝试重写文件系统。
这是我的 htaccess
RewriteEngine On
RewriteRule ^(.*) /var/www/sonarApps/main/com.sonar6.api/account/master/web
这行不通。看起来它总是试图从 apache web root 加载它,所以
/apache/web/root/var/www/sonarApps/main/com.sonar6.api/account/master/web
这是我的日志
10.54.1.188 - - [06/Jun/2013:09:26:14 +0500] [...][rid#2b1b8b4f6ed0/initial] (2) init rewrite engine with requested uri /zef-test/master/api/index.php
10.54.1.188 - - [06/Jun/2013:09:26:14 +0500] [...][rid#2b1b8b4f6ed0/initial] (1) pass through /zef-test/master/api/index.php
10.54.1.188 - - [06/Jun/2013:09:26:14 +0500] [...][rid#2b1b8b4f6ed0/initial] (3) [perdir /var/www/sonarRoot/zef-test/master/api/] strip per-dir prefix: /var/www/sonarRoot/zef-test/master/api/index.php -> index.php
10.54.1.188 - - [06/Jun/2013:09:26:14 +0500] [...][rid#2b1b8b4f6ed0/initial] (3) [perdir /var/www/sonarRoot/zef-test/master/api/] applying pattern '^(.*)' to uri 'index.php'
10.54.1.188 - - [06/Jun/2013:09:26:14 +0500] [...][rid#2b1b8b4f6ed0/initial] (2) [perdir /var/www/sonarRoot/zef-test/master/api/] rewrite 'index.php' -> '/var/www/sonarApps/main/com.sonar6.api/account/master/web'
10.54.1.188 - - [06/Jun/2013:09:26:14 +0500] [...][rid#2b1b8b4f6ed0/initial] (1) [perdir /var/www/sonarRoot/zef-test/master/api/] internal redirect with /var/www/sonarApps/main/com.sonar6.api/account/master/web [INTERNAL REDIRECT]
10.54.1.188 - - [06/Jun/2013:09:26:14 +0500] [...][rid#2b1b8b502f10/initial/redir#1] (2) init rewrite engine with requested uri /var/www/sonarApps/main/com.sonar6.api/account/master/web
10.54.1.188 - - [06/Jun/2013:09:26:14 +0500] [...][rid#2b1b8b502f10/initial/redir#1] (1) pass through /var/www/sonarApps/main/com.sonar6.api/account/master/web
10.54.1.188 - - [06/Jun/2013:09:26:14 +0500] [...][rid#2b1b8b4faef0/initial] (2) init rewrite engine with requested uri /favicon.ico
10.54.1.188 - - [06/Jun/2013:09:26:14 +0500] [...][rid#2b1b8b4faef0/initial] (1) pass through /favicon.ico
阅读 apache mod_rewrite 文档
A full filesystem path to a resource
RewriteRule ^/games /usr/local/games/web
This maps a request to an arbitrary location on your filesystem, much like the Alias directive.
这在我的情况下似乎不起作用。
有任何想法吗?
非常感谢。