Click here to Skip to main content
14,881,887 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi guys,

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

1) Why do these commands don't work:
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.
Posted
Updated 27-Feb-11 3:40am
v2

1 solution

have you tried with : (?)

RewriteRule ^(.*)\/Bing$ $1 [NC,L,R=301]
RewriteRule ^(.*)\/Bing\/(.*)$ $1/$2 [NC,L,R=301]
   
Comments
elad2109 27-Feb-11 10:33am
   
No, but I got the solution for q1:
the regex pattern ignore domain name (from the documentation)

my main problem now is q2
Piccadilly Yum Yum 27-Feb-11 10:56am
   
maybe something wrong with slash beetwen two parameters ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900