Solved

iis7 redirect default.asp to root

Posted on 2010-09-09
3
1,117 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
ID: 33637803
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
ID: 33638171
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
ID: 33649162
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Registering DLL 5 50
Best training I should take for current job? IIS or RSA? 4 27
IIS - one site that hosts many HTTPS domains? 3 37
Bot attack question 11 23
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 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