Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

301 Redirect Questions - www vs non-www

Redirecting the right way with 301



6:24 am on May 9, 2007 (gmt 0)

5+ Year Member

Ok, been doing some house cleaning.

I'm trying to make sure all my url issues are non existent (read: supplemental hell).

So far I have:

http://example.com redirecting to http://www.example.com
http://example.com/test/ redirecting to http://www.example.com/test
http://example.com/test.asp?t=1 redirecting to http://www.example.com/test.asp?t=1

My problem is...

I can't redirect:

http://www.example.com/default.asp to http://www.example.com

FireFox says there is in infinite redirect, and it can't continue.

Anyone have any suggestions?


[edited by: encyclo at 3:04 pm (utc) on May 10, 2007]
[edit reason] switched to example.com [/edit]


1:57 pm on May 10, 2007 (gmt 0)

5+ Year Member

Are you doing this within IIS or using a script to evaluate and rewrite the URL?

I am working on the same thing as you but I also want to include a way to handle typo domains.


3:15 pm on May 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Anyone have any suggestions?

Look into isapi_rewrite


6:21 pm on May 20, 2007 (gmt 0)

5+ Year Member

Yes, it's impossible to redirect http://www.example.com/default.asp to http://www.example.com as you said. Basically I enquired about this on here about a year ago when the duplicate penalties were occuring with Google because of the www and non www issue.

There's only 3 options in my view:
IIS, which is not possible on shared hosting
ISAPI, which again is not an option if you're on shared hosting
or if you are having problems because search engines have indexed www.example.com and www.example.com/default.asp as identical then you should re-save the default.asp file as index.asp (as an example) and do a 301 redirect to the root.

Then go through your site thoroughly and make sure there are no direct links to default.asp and instead things link to the root.
It is possible however (and worthwhile) to 301 redirect http://example.com/default.asp to http://www.example.com

Hope this helps


12:12 pm on May 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

ISAPI, which again is not an option if you're on shared hosting

Some hosting companies will install isapi_rewrite, or similar, if you pay for the license.
You may have to look around a bit, but there are many that do it.


8:12 pm on May 25, 2007 (gmt 0)

5+ Year Member

Rather than using third party tools, you can do a lot in the Application_BeginRequest event in Global.asax.vb. You can intercept specific pages using:-


and do some pretty sophisticated things using...




It is pretty much what Isapi filters do but within .NET itself.


9:21 pm on May 26, 2007 (gmt 0)

10+ Year Member

Assuming you're running a windows server, you'll notice that the default documents are configured with captial letters:

Default.asp etc.

You can 301 redirect http://www.example.com/default.asp to http://www.example.com/ just by checking for the capital (if 'default.asp' then redirect, if 'Default.asp' then dont.)

Of course, it's not 100% perfect, because http://www.example.com/Default.asp exists as a duplicate but you're not likely to be linking internally using a capital letter anywhere in your website and most likely neither is anyone else.

[edited by: Panic_Man at 9:23 pm (utc) on May 26, 2007]


Featured Threads

Hot Threads This Week

Hot Threads This Month