I'm trying to do a 301 redirect all non www. to all www.domainname.com pages, should probably be included in the page_header.php file... Here's what I have:
# <?php
# if(!stristr($_SERVER["HTTP_HOST"], 'www')){
# header("HTTP/1.1 301 Moved Permanently");
# header("Location: http://www.domainname.com/" . $_SERVER["REQUEST_URI"]);
# exit();
# }
# ?>
The only problem is redirects all pages it's on as 301's to the listed domain. How do I make this so it redirects the page it's on if it's http:// to http://www. using 301? The problem is my hosting provider does not allow me to do this with htaccess. This might also be something that you may want to include in a future version of this

English |
French
