2013-05-21 117 views
0

我会在我的本地计算机上的reqrite规则坚果重写......使用相对路径

我甚至能改写日志,这是我从它应该重写URL中的单个页面加载得到:

ip - - [21/May/2013:08:13:18 +0200] [scxx/sid#7f6580ce32b8][rid#7f65810069e0/initial] (2) init rewrite engine with requested uri /catdev/sc/eprocure/ajax/ArticleSearch/SearchEngine/GetInitialData 
ip - - [21/May/2013:08:13:18 +0200] [scxx/sid#7f6580ce32b8][rid#7f65810069e0/initial] (3) applying pattern '^/catdev/sc/eprocure/ajax/(.+)/(\w+)/(\w+?)$' to uri '/catdev/sc/eprocure/ajax/ArticleSearch/SearchEng$ 
ip - - [21/May/2013:08:13:18 +0200] [scxx/sid#7f6580ce32b8][rid#7f65810069e0/initial] (2) rewrite '/catdev/sc/eprocure/ajax/ArticleSearch/SearchEngine/GetInitialData' -> '/catdev/sc/eprocure/ajax/handler.php?pa$ 
ip - - [21/May/2013:08:13:18 +0200] [scxx/sid#7f6580ce32b8][rid#7f65810069e0/initial] (3) split uri=/catdev/sc/eprocure/ajax/handler.php?path=ArticleSearch&class=SearchEngine&method=GetInitialData -> uri=/catde$ 
ip - - [21/May/2013:08:13:18 +0200] [scxx/sid#7f6580ce32b8][rid#7f65810069e0/initial] (2) local path result: /catdev/sc/eprocure/ajax/handler.php 
ip - - [21/May/2013:08:13:18 +0200] [scxx/sid#7f6580ce32b8][rid#7f65810069e0/initial] (1) go-ahead with /catdev/sc/eprocure/ajax/handler.php [OK] 

找到正确的路径,但它仍然没有加载它应该的页面。我不知道为什么!

错误日志告诉我这个。

[Tue May 21 08:13:18 2013] [error] [client xxx.xxx.xxx.xx] File does not exist: /catdev/sc/eprocure 

现在我有theese重写规则我我的Apache配置:

<VirtualHost *:80> 
     ServerAdmin [email protected] 
     ServerName xxx 
     DocumentRoot /data1/www/somewherefarbeyond/ssl-htdocs 

     <Directory /data1/www/somewherefarbeyond/ssl-htdocs/> 
       Options Indexes FollowSymLinks MultiViews 
       AllowOverride None 
       Order allow,deny 
       allow from all 
     </Directory> 

     ErrorLog /data1/www/somewherefarbeyond/logs/error.log 

     # Possible values include: debug, info, notice, warn, error, crit, 
     # alert, emerg. 
     LogLevel warn 

     CustomLog /data1/www/somewherefarbeyond/logs/access.log combined 


     RewriteEngine On 
     RewriteRule ^/catdev/sc/eprocure/ajax/(.+)/(\w+)/(\w+?)$  /catdev/sc/eprocure/ajax/handler.php?path=$1&class=$2&method=$3 [L] 
     RewriteLog /data1/www/somewherefarbeyond/logs/accessREWRITE.log 
     RewriteLogLevel 9 

</VirtualHost> 

能有人为粉碎一些轻到这件事情?

他的URL我尝试演XXX/catdev/SC/eprocure/AJAX/ArticleSearch /的搜索引擎/ GetInitialData

注XXX是从我的开发服务器和IPS手owerwriten杜曼的obscurified到。

+0

Strangly当我添加重定向URL为绝对URL它被重定向。但外部,而不是内心黯然Q_Q ...任何人有任何想法为什么? – Sangoku

回答

0

上帝该死的。

Iw的是Debian的“功能”

我在Debian发行版的工作,并有一些奇怪的原因,当你在你指定的整个目录路径而不是相对路径的基本配置进行重写。

只要重写URL的目录位置不是URL!

例子是:

您的www文件夹是在

/motherofGod/wtf/www 

您的www根设置为/motherofGod/wtf/www在apatche

您的域名是lols.com

因此文件lols.com/lol/wtf

需要t O操作上/motherofGod/wtf/www/some/crap/handler.php

OU必须指定整个路径不只是从www目录的相对路径〜_〜