Darkbyte Library

Nonstandard Web Browser

It appears that your browser does not comply with the W3C web standards which define how web pages are encoded, transmitted, and rendered. This site would look much better in a standards-compliant web browser, but its content is accessible to any browser or Internet device.

NoWWW :: www. is deprecated.

Download

License : GPL

Description :
Simple PHP code to make your website a Class B compliant no-www.org website.

Source Code :


<?php
	/*************************************************************************************
	 * no-www.php
	 * ----------
	 * Author: Alan Doyle (alan.doyle@darkbyte.com)
	 * Copyright: (c) 2005 Darkbyte Software
	 * Release Version: 1.0
	 * Date Started: 2005/05/09
	 *
	 * Class B Compliance for NO-WWW.ORG. Please refer to the http://no-www.org for more
	 * the no www philosophy.
	 *
	 * Assumption:
	 *             www.domain.com and domain.com exist and point to the same location.
	 *
	 *************************************************************************************
	 *
	 *   no-www.php is free software; you can redistribute it and/or modify
	 *   it under the terms of the GNU General Public License as published by
	 *   the Free Software Foundation; either version 2 of the License, or
	 *   (at your option) any later version.
	 *
	 *   no-www.php is distributed in the hope that it will be useful,
	 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
	 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	 *   GNU General Public License for more details.
	 *
	 *   You should have received a copy of the GNU General Public License
	 *   along with no-www.php; if not, write to the Free Software
	 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	 *
	 ************************************************************************************/
 
	if( strncmp( "www.", $_SERVER['HTTP_HOST'], 4 ) == 0 )
	{
		$host = substr ( $_SERVER['HTTP_HOST'], 4 );
		$site = $_SERVER['REQUEST_URI'];
		header("Location: http://$host$site");
		exit;
	}
?>
Copyright © 2000-2008 Darkbyte Software, All Rights Reserved. 
Please direct your questions or comments to

CCBot/1.0 (+http://www.commoncrawl.org/bot.html) [38.103.63.57 ( )]