MyBB Community Forums

Full Version: Use 301 redirects
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Don’t Forget Canonicalization:

If you want to maximize your search engine results while also improving your ability to track your site’s traffic, then you need to ensure that your pages aren’t being counted more than once. Your home page may be coming up in different ways as http://yourdomain.com, http://www.yourname.com and http://www.yourdomain.com/index.html. This can confuse the search engines and impact your tracking stats. Use 301 redirects to move your pages to one home page, and fix any issues with other pages on your site as well.

i just want to know how can i do this? i am on windows hosting, does it required some sort of plugin or i need to perform this from my hosting control panel?
i found this from some where, first tell is this a correct code, if yes then tell me where to place this code
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?> 
I'm honestly not sure what that code is. I personally prefer .htaccess redirects and they are pretty simple.

There is even a generator for them.
http://www.htaccessredirect.net/(never used it honestly don't know how well it works but I would imagine fine since again they are pretty simple).

Otherwise here's a good page to read.
http://www.webweaver.nu/html-tips/web-redirection.shtml
The PHP code is wrong. First, you're not supposed to use <? and ?> as it is not cross-server compatible.

iirc, there can only be one header (probably wrong) and it's header, not Header.

As Alex said, just use .htaccess to point a url elsewhere than a php script. Smile