Solved

iis7 redirect default.asp to root

Posted on 2010-09-09
3
1,126 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

623 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