Solved

iis7 redirect default.asp to root

Posted on 2010-09-09
3
1,112 Views
Last Modified: 2012-05-10
A customer wants http://www.hisdomain.com/default.asp redirected to http://www.hisdomain.com/   (i.e. without the default.asp bit).

I tried using the HTTP Redirect in IIS7 but it just causes a loop / error - is it possible to do this somehow?
0
Comment
Question by:ascendinternet
  • 2
3 Comments
 
LVL 30

Expert Comment

by:Brad Howe
Comment Utility
Hi,
I assume you have a default File configured to IIS Manager.
SERVER | Sites | Site | In the Feature Pane | Select Default Document | make sure default.asp is added.
If ASP components were added after the site creation, they may not be present.
-Hades666
0
 

Author Comment

by:ascendinternet
Comment Utility
default.asp is in the list of "default documents" and requesting http://www.hisdomain.com/ works (and shows default.asp).

However, the issue is if http://www.hisdomain.com/default.asp is requested (e.g. via Google or 3rd party link) then it needs to do a permanent redirect to http://www.hisdomain.com/.

The "problem" is Google has both indexed and treats them as duplicates, so the customer wants to effectively remove the "/default.asp" entry (by permanently redirecting).
0
 
LVL 30

Accepted Solution

by:
Brad Howe earned 500 total points
Comment Utility
Hi,

Ok i understand what you are trying to accomplish. This is for SEO...

To remove and redirect default.aspx from the URL, you'd use :

1. Install IIS Rewrite Module.

2. Open your Web.Config under your root site and add the following.

         <rule name="Hide and Redirect default.asp to Root." stopProcessing="true">
                   <match url="^(.*)$" ignoreCase="false" />
                   <conditions logicalGrouping="MatchAny">
                        <add input="{URL}" pattern="^(.*)/default.asp" />
                   </conditions>
                   <action type="Redirect" url="{C:1}" appendQueryString="false" />
         </rule>

The {C:1} MAY be different, so when you add this, open IIS Manager and in the URL rewrite Feature run a test against the RegEx to make sure it is validating correctly.

I just tested this and it works fine.

Cheers,
Hades666
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now