Click here to Skip to main content
15,117,318 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$ [NC,L,R=301]
RewriteRule ^(.*)\/Bing\/(.*)$ /$2 [NC,L,R=301]

2) I want to use htaccess for the following manipulation:
current url =POST

{Param2= x (some const value)}

Will be silently converted to
POST (not GET!)

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

Thanks in advance to any assistance.
Updated 27-Feb-11 4:40am

1 solution

have you tried with : (?)

RewriteRule ^(.*)\/Bing$ $1 [NC,L,R=301]
RewriteRule ^(.*)\/Bing\/(.*)$ $1/$2 [NC,L,R=301]
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