Adding Redirects using Asp.net

Hi All,

I am looking for some advice to help with the following scenario (I am still learning VB.net with ASP) I have looked on Google but I have hit a dead end now.

the first issue that I am having is trying to redirect
www.samplesite.com/press.aspx
to
www.samplesite.com/press/press.aspx
I have tried to use Rewrite Rules in the web.config without success.

the next issue I am having is I want any request for the homepage not using the default url to redirect to the default url, it also needs to preserve the query string if any. for example please see below:

https://samplesite.com/home.aspx?key=value

Returns a 301 redirect to:

https://samplesite.com/?key=value

And:

https://samplesite.com/home.aspx/anything?key=value

Redirects to:

https://samplesite.com/?key=value

I would be grateful for any assistance on this.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.