I want to rewrite this simple url www.xyz.com/defalt.aspx?Id=1&Product=Acid. in format like
www.xyz.com/1/acid
Plz provide the full code to this.And more question that after rewriting the url how to get the QueryString.
For the question I quoted that I think you had got the answer. For the new problem, please create a new thread and I think you will get more fresh help there.
This will change the url rather than silently rewriting it. I know you dont want that but for testing purposes you can see what value is being captured and put into the url.
Asp.NET Prof...
Member
51 Points
199 Posts
Re: Url rewriting
Jan 20, 2010 03:07 PM|LINK
Im using this on the same page.
Im able to get Id and not able to get product.
means im making some mistake in the regular expression only plz give the regular expression for
Product.aspx?Id=1&Product=Acid.
Plz help me out
Mobile:9370350449
ankitcol@gmail.com
Mumbai
rtpHarry
All-Star
56620 Points
8958 Posts
Re: Url rewriting
Jan 20, 2010 08:06 PM|LINK
-- edit -- oops managed to double post this one
rtpHarry
All-Star
56620 Points
8958 Posts
Re: Url rewriting
Jan 20, 2010 08:07 PM|LINK
Please give more information and be specific and accurate about it [:)]
the regex extracts information from the url that is requested (the clean url)
Please give a full and clean example of the request url that you need to rewrite
Please then give a full and clean example of the url you want to turn it into.
For example, the last post you made has a random . on the end and I don't know if you want that including or are making mistakes.
Jerry Weng -...
All-Star
29527 Points
3488 Posts
Re: Url rewriting
Jan 21, 2010 05:37 AM|LINK
Hi,
For the question I quoted that I think you had got the answer. For the new problem, please create a new thread and I think you will get more fresh help there.
Asp.NET Prof...
Member
51 Points
199 Posts
Re: Url rewriting
Jan 21, 2010 05:43 AM|LINK
I want to rewrite the Url for
www.xyz.com/products.aspx?id=1&product=acid
I want to rewrite this url.
plz help
Mobile:9370350449
ankitcol@gmail.com
Mumbai
venkatu2005
All-Star
32487 Points
6742 Posts
Re: Url rewriting
Jan 21, 2010 05:50 AM|LINK
hi , you already did it for single querystring the same way do it for the second querystring too..
Thanks.
rtpHarry
All-Star
56620 Points
8958 Posts
Re: Url rewriting
Jan 21, 2010 07:20 AM|LINK
The regex i gave you should work for the url you are giving. I am wondering if its the & thats causing problems.
Two things you can try:
Try swapping the $1 and $2 parameters around so you get:
This will change the url rather than silently rewriting it. I know you dont want that but for testing purposes you can see what value is being captured and put into the url.
rtpHarry
All-Star
56620 Points
8958 Posts
Re: Url rewriting
Jan 21, 2010 07:23 AM|LINK
Also can you post the code you are using to extract the value... like your
part so we can be sure that you haven't made a mistake at that end.
rtpHarry
All-Star
56620 Points
8958 Posts
Re: Url rewriting
Jan 22, 2010 08:40 AM|LINK
Any updates?