我在IBM HTTP Server的httpd.conf
中设置了重写规则,规则是
<IfModule mod_ibm_ssl.c>
Listen 0.0.0.0:443
<VirtualHost *:443>
RewriteEngine on
RewriteOptions inherit
RewriteLog "/opt/IBM/HTTPServer/logs/rewritelog"
RewriteLogLevel 7
RewriteCond %{REQUEST_URI} ^(.*)qkr(.*)$
RewriteCond %{QUERY_STRING} ^(.*)follow(.*)$
RewriteRule ^dm/(.*)$ /dmRedirect/$1 [R=301,L]
</VirtualHost>
</IfModule>
目的是转换如下的网址:
https://connectionsww.demos.ibm.com/dm/atom/library/A/media/install.log.qkr?follow=true&errorPage=true
到
https://connectionsww.demos.ibm.com/dmRedirect/atom/library/A/media/install.log.qkr?follow=true&errorPage=true
我重新启动了HTTP服务器(可能没有必要),结果是重写不起作用。在我的rewritelog文件中:
9.156.181.51 - - [07/May/2014:16:15:40 +0200] [connectionsww.demos.ibm.com/sid#2365f18][rid#7f688c014928/initial] (1) pass through /dm/atom/library/ECD7B321-7729-430F-9F5C-9279D83EF13E;D826C8CD-2B72-4546-82AF-A3D23377C061/feed
9.156.181.51 - - [07/May/2014:16:15:44 +0200] [connectionsww.demos.ibm.com/sid#2365f18][rid#7f688c018948/initial] (2) init rewrite engine with requested uri /dm/atom/library/ECD7B321-7729-430F-9F5C-9279D83EF13E;D826C8CD-2B72-4546-82AF-A3D23377C061/document/{F2CA2079-F96F-4B3C-8B87-5CB0B616D743}/entry
9.156.181.51 - - [07/May/2014:16:15:44 +0200] [connectionsww.demos.ibm.com/sid#2365f18][rid#7f688c018948/initial] (3) applying pattern '^dm/(.*)$' to uri '/dm/atom/library/ECD7B321-7729-430F-9F5C-9279D83EF13E;D826C8CD-2B72-4546-82AF-A3D23377C061/document/{F2CA2079-F96F-4B3C-8B87-5CB0B616D743}/entry'
9.156.181.51 - - [07/May/2014:16:36:30 +0200] [connectionsww.demos.ibm.com/sid#12cfbf8][rid#7f9f04014928/initial] (3) applying pattern '^dm/(.*)$' to uri '/dm/atom/library/ECD7B321-7729-430F-9F5C-9279D83EF13E;D826C8CD-2B72-4546-82AF-A3D23377C061/document/{F2CA2079-F96F-4B3C-8B87-5CB0B616D743}/media/install.log.qkr'
9.156.181.51 - - [07/May/2014:16:36:30 +0200] [connectionsww.demos.ibm.com/sid#12cfbf8][rid#7f9f04014928/initial] (1) pass through /dm/atom/library/ECD7B321-7729-430F-9F5C-9279D83EF13E;D826C8CD-2B72-4546-82AF-A3D23377C061/document/{F2CA2079-F96F-4B3C-8B87-5CB0B616D743}/media/install.log.qkr
9.156.181.51 - - [07/May/2014:16:39:35 +0200] [connectionsww.demos.ibm.com/sid#1d5bbf8][rid#7f3020014648/initial] (2) init rewrite engine with requested uri /communities/service/html/communityview
表示
1)即使URL与RewriteCond不匹配(以/communities/...
开头),启动重写引擎并尝试将RewriteRule模式应用于它?
2)没有重写信息,因为URL没有重写也是如此。
我也尝试将Rewrite代码放入:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteOptions inherit
RewriteLog "/opt/IBM/HTTPServer/logs/rewritelog"
RewriteLogLevel 7
RewriteCond %{REQUEST_URI} ^(.*)qkr(.*)$
RewriteCond %{QUERY_STRING} ^(.*)follow(.*)$
RewriteRule ^dm/(.*)$ /dmRedirect/$1 [R=301,L]
</IfModule>
同样的结果。
有什么想法吗?谢谢!