Mobile app version of vmapp.org
Login or Join
Murray432

: How to enforce WWW without htaccess URL canonization is an important aspect in SEO, now I have a website hosted on Yahoo my small business which doesn't allow for .htaccess to be uploaded,

@Murray432

Posted in: #Redirects #Seo

URL canonization is an important aspect in SEO, now I have a website hosted on Yahoo my small business which doesn't allow for .htaccess to be uploaded, now in such a case how do I keep my domain consistent.

HERE is a Chris coyer script i came across, it shows how to make the URL, consistent using the .htaccess file. but now obviously I can't use the .htaccess file , so how to I make my URL consistent when my host doesn't allow me to upload a .htaccess file?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray432

1 Comments

Sorted by latest first Latest Oldest Best

 

@Chiappetta492

You could make a very simple test to see if there is www in the URL, and if it hasn't, go to the www version via a 301 permanently moved header:

if( substr($_SERVER['HTTP_HOST'],0,4)!='www.'){
header('Location: www.'$_SERVER['HTTP_HOST'].'/'.$_SERVER['REQUEST_URI'], true, 301);
}


Don't forget to set your canonical tags to www so bots know your preferred URL.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme