NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page ASP 301 redirect from www to non

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 12-13-2005, 12:39 PM THREAD STARTER               #1 (permalink)
tgo
NamePros Regular
Join Date: Aug 2005
Posts: 315
tgo is on a distinguished road
 



ASP 301 redirect from www to non


I am looking to create a 301 redirect from my www(dot)name.com to just name.com

I run a dedicated windows server so I cant use htaccess, I also dont pay for mod rewrite. So how can I redirect the www to non www.

I can write asp that does the 301, but how do I detect that there is a www in the url? Do I just read the current page name and do a instring function to check? Then redirect to itself without the www if needed....

Any easier way to do this? This way I would have to have this code on all my pages to jump out of www when needed.
Last edited by tgo; 12-13-2005 at 12:59 PM.
tgo is offline  
Old 12-13-2005, 05:36 PM   #2 (permalink)
Senior Member
 
def1's Avatar
Join Date: May 2005
Posts: 1,538
def1 has a spectacular aura aboutdef1 has a spectacular aura about
 



i would think redirecting to a link without the www will work
__________________
Did you try my toolbar? Works in Firefox and IE!
http://www.bumrecords.net - Fun Games, Music, Discussion, And Much More!
upload²
•Pick the Web Hosting Company most NamePros Members Use Pick Chronichosting!•
def1 is offline  
Old 12-14-2005, 04:21 PM   #3 (permalink)
mch
NamePros Regular
Join Date: Nov 2005
Location: EU
Posts: 248
mch is on a distinguished road
 



Sorry I don't know ASP, but here's the code in PHP, I hope it helps!

PHP Code:
if ($_SERVER['HTTP_HOST'] == "http://www.mysite.com")
????: NamePros.com http://www.namepros.com/programming/147805-asp-301-redirect-from-www-non.html
{
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://mysite.com");

mch is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp 301 redirect tgo Search Engines 0 10-06-2005 04:15 AM
redirect url .htaccess code dotcommakers The Break Room 1 08-09-2005 02:18 PM
enom question - does the redirect use 301 redirects? rb Domain Name Discussion 11 06-04-2005 07:42 PM
Advertise on Redirect Plus - Starting at $2.95/mo! LeKiz Advertising & SEO Services 0 04-27-2005 10:25 AM
Page Rank 7 names, 50k+ LinkPop names, etc. Huge sale! including counter.li domplace.info Domains For Sale - Make Offer 0 11-18-2004 09:38 AM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:05 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger