Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Closed Thread
ASP 301 redirect help...or IIS7 web.config
Old 12-23-2009, 06:05 PM ASP 301 redirect help...or IIS7 web.config
kline11's Avatar
SearchBliss Web Tools

Posts: 1,726
Name: John
Location: USA
Trades: 0
I have an ASP forum that shows .../forum/ and .../forum/default.asp as duplicate content on Google webmaster tools. I want to use a 301 redirect to solve the issue. I first added this to the web.config file:
Code:
<location path="forum/default.asp">
    <system.webServer>
        <httpRedirect enabled="true" destination="http://www.searchbliss.com/forum/" exactDestination="true" httpResponseStatus="Permanent" />
    </system.webServer>
</location>
This worked fine, until I realized the sub-forums used default.asp with query strings, which was redirected to ...forum/

I can't find a way to only redirect if NO query string is present using the web.config (iis7).

Is there a way to do this with ASP???

Thanks!

P.S. Calling Chris Hirst or any equivalents!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is offline
View Public Profile
 
 
Register now for full access!
Old 12-23-2009, 06:14 PM Re: ASP 301 redirect help...or IIS7 web.config
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yoo Hoo!
Because the server will automatically redirect "/" to "/default.asp", that will cause a locked loop on the server.

To avoid the issue you have to redirect on the REQUESTED page NOT the served page

here's something I prepared earlier. (much earlier)
http://www.highrankings.com/forum/in...dpost&p=242355
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 12-23-2009 at 06:16 PM..
chrishirst is offline
View Public Profile Visit chrishirst's homepage!
 
Old 12-24-2009, 12:14 PM Re: ASP 301 redirect help...or IIS7 web.config
kline11's Avatar
SearchBliss Web Tools

Posts: 1,726
Name: John
Location: USA
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Yoo Hoo!
Because the server will automatically redirect "/" to "/default.asp", that will cause a locked loop on the server.

To avoid the issue you have to redirect on the REQUESTED page NOT the served page

here's something I prepared earlier. (much earlier)
http://www.highrankings.com/forum/in...dpost&p=242355
Ahhhhh! Thanks Chris. Happy Holidays!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is offline
View Public Profile
 
Old 12-26-2009, 05:03 PM Re: ASP 301 redirect help...or IIS7 web.config
kline11's Avatar
SearchBliss Web Tools

Posts: 1,726
Name: John
Location: USA
Trades: 0
Quote:
Originally Posted by kline11 View Post
I have an ASP forum that shows .../forum/ and .../forum/default.asp as duplicate content on Google webmaster tools. I want to use a 301 redirect to solve the issue. I first added this to the web.config file:
Code:
<location path="forum/default.asp">
    <system.webServer>
        <httpRedirect enabled="true" destination="http://www.searchbliss.com/forum/" exactDestination="true" httpResponseStatus="Permanent" />
    </system.webServer>
</location>
This worked fine, until I realized the sub-forums used default.asp with query strings, which was redirected to ...forum/

I can't find a way to only redirect if NO query string is present using the web.config (iis7).

Is there a way to do this with ASP???

Thanks!

P.S. Calling Chris Hirst or any equivalents!
Hey Chris,
I can't seem to get the example you sent me to work? UG!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is offline
View Public Profile
 
Old 03-28-2010, 05:13 PM Re: ASP 301 redirect help...or IIS7 web.config
kline11's Avatar
SearchBliss Web Tools

Posts: 1,726
Name: John
Location: USA
Trades: 0
Hey Chris,
I found an IIS7 web.config file solution that works. I thought I'd post it for others:
Code:
       <rule name="Default Document" stopProcessing="true"> 
          <match url="(.*)default.asp" />
          <action type="Redirect" url="{R:1}" redirectType="Permanent" /> 
        </rule>
Thanks again!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is offline
View Public Profile
 
Closed Thread     « Reply to ASP 301 redirect help...or IIS7 web.config
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.59768 seconds with 12 queries