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
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.
You can preserve post data by adding another directive along with your NC, R i.e. P, which stands for preserving post data.
精彩评论