Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
no-www

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> PHP
View previous topic :: View next topic  
Author Message
deejay
Forum Assistant
Forum Assistant


Joined: 17 May 2006
Posts: 78
Location: Netherlands

PostPosted: Fri Aug 25, 2006 3:14 pm    Post subject: no-www Reply with quote

Hi,

if you want to obey to the no-www politics, this is a useful php script, if you don't have access to htaccess or apache redirects.

Code:
function no_www() {
if (substr( $_SERVER['HTTP_HOST'], 0,4) != 'www.' ) {
   return; } else {
   // header('HTTP/1.1 301 Moved Permanently');
   if($_SERVER['QUERY_STRING']) {
   $string = '/?' . $_SERVER['QUERY_STRING'];
   } else {
   $string = '';
   }

   header('Location: http://' . substr($_SERVER['HTTP_HOST'], 4) . $string);
   phpinfo();
   exit();
   
   }
}

no_www();


it validates on no-www.org as NA; meaning it doesn't detect this script, which is a pity.

rgds dj
_________________
please correct me if i am wrong
seo-expertglobalwarming
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
vikas1234
Frequent Poster
Frequent Poster


Joined: 24 Aug 2008
Posts: 29

PostPosted: Thu Feb 26, 2009 5:29 pm    Post subject: Reply with quote

well i know php but this was new for me thanks ........
_________________
Free Online Books|Free pdf Books |free AJAX Books
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> PHP All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert