开发者

htaccess passing params wth POST mechanism

Got 2 htaccess questions, hopefully you could help me out:

1) Why do these commands don't work:

开发者_JS百科RewriteRule ^(.*)\/Bing$ http://$1 [NC,L,R=301]

RewriteRule ^(.*)\/Bing\/(.*)$ http://$1/$2 [NC,L,R=301]

while these do work:

RewriteRule ^(.*)\/Bing$ http://www.myDomain.com [NC,L,R=301]
RewriteRule ^(.*)\/Bing\/(.*)$ http://www.myDomain.com /$2 [NC,L,R=301]

2) I want to use htaccess for the following manipulation:

when

current url =POST http://www.myDomain.com/

HTTP_REFERER = //www.myDomain.com/3

{Param2= x (some const value)}

will be silently converted to

POST (not GET!) http://www.myDomain.com/Myservice.asmx/Foo

{Param1 = 3, Param2= x (stays the same as before manipulation)}

Thanks in advance to any assistance


  1. RewriteRule does not ever get the host. Just the path, you will have to use RewriteCond with HTTP_HOST to do anything with the host.

  2. You can preserve post data by adding another directive along with your NC, R i.e. P, which stands for preserving post data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜