301 Redirect code for IIS

Posted on 2005-05-11
Medium Priority
Last Modified: 2010-04-27

i need the 301 redirect code for IIS.

Question by:mcse20002000
  • 3
LVL 33

Assisted Solution

humeniuk earned 2000 total points
ID: 13983849
It's not code as with Apache/.htaccess.

What you do is go into your website properties via Internet Services Manager.  Under the 'Home Directory' tab, select 'A redirection to a URL' rather than 'A directory located on this computer'.  Then type the desination in the 'Redirect to:' field and make sure you check the 'A permanent redirection for this resource' box (this is what makes it a 301 redirect).

FYI - you can redirect an entire website as above, or a specific folder or even file via 'right-click' -> 'properties'.
LVL 33

Accepted Solution

humeniuk earned 2000 total points
ID: 13983862
BTW - you can find the official Microsoft info on this here: http://support.microsoft.com/default.aspx?scid=kb;en-us;313074.  The info refers to IIS5, but is applicable to II6 as well.
LVL 13

Expert Comment

ID: 14095339
For all those still looking for the exact code, just add this to the top of your code:
Response.Status = "301 moved permanently"
Response.addheader "Location", "http://www.whereveryouwanttosendthepoorguy.com"
LVL 33

Expert Comment

ID: 14095616
To clarify - that is ASP 301 redirect code.

Featured Post

Eye-catchers on the conference table

Challenge: The i-unit group was not satisfied with the audio quality during remote meetings. They were looking for a portable solution with excellent audio quality for use in their conference room but also at their client’s offices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn about the eCommerce marketing trends for the year ahead.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question