/ Published in: PHP
Removes WWW from the current URL, if exists.
Expand |
Embed | Plain Text
Comments
Subscribe to comments
You need to login to post a comment.
Removes WWW from the current URL, if exists.
Subscribe to comments
You need to login to post a comment.
if ( 0 === stripos( $_SERVER['HTTP_HOST'], 'www.' ) ) { header( 'HTTP/1.1 301 Moved Permanently' ); header( 'Location: http://' . substr( $_SERVER['HTTP_HOST'], 0, 4 ) . $_SERVER['REQUEST_URI'] ); exit; }