Add Full QueryString as a Url Encoded Param
4 posts
• Page 1 of 1
- programmer27
- Posts: 7
- Joined: 23 Aug 2012, 21:09
Add Full QueryString as a Url Encoded Param
I would like to add the full input url as a param to my querystring, but this would have to be url encoded in order for my page to see it as one value:
Here is what i have so far:
RewriteProxy ^(/help/(mySpecificPage)/?\?(.*)) http://www.mySite.com/page.aspx?name=$2 ... origUrl=$1 [D,U,I]
I capture the entire url as $1 - but is there a way for me to add it as something like &origUrl=[url]$1[/url] ?
Thanks!
Here is what i have so far:
RewriteProxy ^(/help/(mySpecificPage)/?\?(.*)) http://www.mySite.com/page.aspx?name=$2 ... origUrl=$1 [D,U,I]
I capture the entire url as $1 - but is there a way for me to add it as something like &origUrl=[url]$1[/url] ?
Thanks!
Re: Add Full QueryString as a Url Encoded Param
programmer27 wrote:I would like to add the full input url as a param to my querystring, but this would have to be url encoded in order for my page to see it as one value:
Here is what i have so far:
RewriteProxy ^(/help/(mySpecificPage)/?\?(.*)) http://www.mySite.com/page.aspx?name=$2 ... origUrl=$1 [D,U,I]
I capture the entire url as $1 - but is there a way for me to add it as something like &origUrl=[url]$1[/url] ?
Unfortunately, there is no way to do exactly that, because ISAPI_Rewrite does not do any urlencoding. But, you could copy HTTP_X_REWRITE_URL value into a custom header and this header will be passed along with a proxy request. So, you will be able to get it.
- programmer27
- Posts: 7
- Joined: 23 Aug 2012, 21:09
Re: Add Full QueryString as a Url Encoded Param
Can you show me how to do this, I am having trouble with the syntax. Thanks!
Re: Add Full QueryString as a Url Encoded Param
programmer27 wrote:Can you show me how to do this, I am having trouble with the syntax. Thanks!
For example,
- Code: Select all
RewriteCond X-Rewrite-URL: (.+)
RewriteHeader X-Original-URL: .* $1
Then you will be able to get the original URI from the X-Original-URL header.
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 9 guests