We help IT Professionals succeed at work.

redirect asp.net 2.0 pages

sunny-j
sunny-j asked
on
Medium Priority
645 Views
Last Modified: 2008-02-01
Hi there

I have a server set up and am pointing .co.uk domain names to it.

In order to redirect the request when it hits my server, i have added this code to the iisstart page.


If HTTPHost = "www.domain.co.uk" then
    Response.Redirect ("http://www.domain.co.uk/folder")
End If

Now, i would prefer not to show the folder in the line so that pages are seen in the browser as www.domain.co.uk/default.aspx etc.,

Is there a way of doing this.
I am also conscious of the effect of the redirect might have on google rankings.

Any advise, much appreciated.

The server is hosting windows 2000 small business server if this helps.

thanks.
Comment
Watch Question

Software Team Leader
Commented:
try
Server.Transfer("/folder")

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
thanks for this. i could not get it to work though.

is this correct

If HTTPHost = "www.domain.co.uk" then
    server.transfer ("/folder")
End If

It didn't redirect it to the folder i had in mind but simply showed the iisstart page.
any ideas of where i am going wrong. thanks.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.