NYCPHP Meetup

NYPHP.org

[nycphp-talk] Removing www.

David Krings ramons at gmx.net
Thu Feb 8 06:49:46 EST 2007


inforequest wrote:
> Chris Shiflett shiflett-at-php.net |nyphp dev/internal group use| wrote:
> 
>> Joseph Crawford wrote:
>>  
>>
>>> Hey guys, what would i need to do in order to make all of the
>>> www. be removed from my urls?
>>>   
>>
>>>> From http://no-www.org/:
>>

> ummm..... be careful when taking code snippets and standards advice from 
> a site that doesn't validate and is broken in IE7. Especially when it 
> promotes a back link campaign IMHO.
> 
> However, the code looks correct if that is what you want to do. I would 
> also make sure that the site is not spiderable via https: so that you 
> don't get traffic bypassing your rewrite rule (or perhaps a port 443 
> check to the rewrite rule).
> 
> -=john andrews
> 


This discussion is interesting. From my limited DNS and records 
knowledge, I used register.com way back when and was able to simply not 
put anything other than the static IP in. That means, http://mysite.com 
went to port 80, ftp://mysite.com to port 21. It also doesn't matter if 
one put the www in front of it. My experience is that even an 
http://fgudf.mysite.com will resolve fine, even when it doesn't point to 
anything in particular. Also http://gggg.dddd.ssss.mysite.com works, but 
http://abcdef.www.mysite.com doesn't, which is a bid odd.

So getting the www off from your site url is pretty easy. Simply point 
the main name to the server IP and call it done. I think though that 
will not stop people from putting the www in and get to your site anyway.

Besides that, your question was also interpreted to ask for replacing 
the www in any url within a script. Wouldn't there a simply string 
replace do the job?




More information about the talk mailing list