I have the following url which i want to write a helicon Rewrite开发者_StackOverflow社区Rule rule it should check the pattern startat=/mypage.asp and then only execute
Original url
http://www.test.com/welcome.asp?startat=/mypage.asp&value1=23&value2=3434&value3=1&value4=someothervalue
the new url
http://www.test.com/mynewpage.hcx?startat=/mypage.asp&value1=23&value2=3434&value3=1&value4=someothervalue
as i am new to helicon and regex ,can someone help me
appreciate your help
something like:
RewriteRule ^/welcome.asp(.+)$ /mynewpage.hcx$1 [RP]
Will match any url starting with /welcome.asp, and $1 will contain the rest of the url.
Not sure about the [] part, but RP is permanent redirect (aka, 301)
EDIT: You could try this:
RewriteRule ^/welcome.asp(.startat=/mypage.asp.)$ /mynewpage.hcx$1 [RP]
.* <- 0 or more chars .+ <- 1 or more chars
so basically it translates to: start with /welcome.asp, 0 or more chars followed by "startat=/mypage.asp", followed by 0 or more chars until end of url.
Redirect to mynewpage.hcx followed by any content from the first paranthesis.
精彩评论