Archive for July, 2013

PHP Redirect 301 Permanently

Sometimes you might want to redirect your visitors to a new URL address. This article will show you how to make a PHP redirect using the 301 “moved permanently” redirection. This is the one you should use as it is the most search engine friendly. Like the name suggests, PHP redirect tells the browser (or a search engine bot) that the page has been permanently moved to a new location.

PHP Redirect Code

To redirect people and robots to a new location use this PHP redirecting code:

header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.New-Website.com");

You could skip the 301 Moved Permanently tag and use just:

header("Location: http://www.New-Website.com");

But this would result in a “302 Moved Temporarily” redirect instead of a 301 one. This should be avoided as permanent redirects are more search engine friendly and should be used where possible.

You can enter any sub-page for the location, this PHP code will redirect users to the test.php sub-page of your website:

header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.New-Website.com/test.php");

It is important that you don’t have any other code (including empty rows and spaces) before the above PHP redirect code. If you do you will get a nice headers already sent notice from PHP and the redirect will not work.

That’s it! Enjoy redirecting PHP pages.

No Comments

How to reset Zimbra Admin Password

To reset the administrative password:

su - zimbra
zmprov sp <admin email address> <new password>

To get a list of all administrators:

su - zimbra
zmprov gaaa

Remember that the administrative console (sometimes) requires a full email address as the login name, so you may be using the correct password and the wrong login!

No Comments