Solved

iis7 redirect default.asp to root

Posted on 2010-09-09
3
1,116 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
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…
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

911 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

24 Experts available now in Live!

Get 1:1 Help Now