Saturday, February 6, 2010
Redirecting On a Zeus Server
Zeus Page Redirects
When you move a page on your website you will want both the users and the search engines to know where it has moved to and be redirected there automatically. This is vital if you, firstly, don’t want users to get the annoying ‘Page Not Found’ error message from a page they’d previously bookmarked or clicked on in Google and, secondly, for keeping hold of the search engine page rank for the page that you’d spent ages building up.
There are a number of methods available for doing a redirect (such as using META redirects) but the only truly search engine friendly way is to add some lines to your .htaccess file in the root of your web folder.
Firstly get the .htaccess file either via FTP or a File Manager type program provided by your domain host. Then, after making a backup of the file, edit it in a text editor such as notepad. If the file doesn’t exist yet in your root web folder, then you can just create a new file in your text editor and then save it as .htaccess.
At the end of the .htaccess file you will need to add a line for each file/folder you want to redirect in the form:
redirect permanent old-url-path[*] new-url
Each parameter is separated by a space (spacebar) character, where:
‘redirect’ is an instruction that a page has moved.
‘permanent’ implies that the page has been permanently moved. There are other options but this is the only one that keeps hold of your page rank.
‘old-url-path[*]’ is the old path to where the page used to be (The * is an optional wildcard).
‘new-url’ is the absolute url to the new page.
Note the ‘new-url’ can be the path from the root of your web site (eg /folder/file.txt) but to be completely reliable you should include the domain also (eg http://www.yourdomain.co.uk/folder/file.txt) – this can be just copied from your browser address bar.
Here are some examples:
Page Moved
You’ve renamed your page in the root folder from ‘old_file.htm’ to ‘new_file.htm’:
redirect permanent /old_file.htm http://www.yourdomain.co.uk/new_file.htm
You’ve moved your page ‘file.php’ from the ‘subpages’ directory to the root directory:
redirect permanent /subpages/file.php http://www.yourdomain.co.uk/file.php
You’ve spaces in the original page name ‘old file with spaces.txt’, so you need to put it in double quotes:
redirect permanent "/folder/old file with spaces.txt" http://www.yourdomain.co.uk/folder/new_file.txt
Folder Moved
You’ve renamed a folder from ‘old_folder’ to ‘new_folder’ and the files are the same within:
redirect permanent /old_folder http://www.yourdomain.co.uk/new_folder
Domain Moved
You’ve moved all your pages, files and folders from www.old_domain.co.uk to www.new_domain.co.uk , in the .htaccess file on the old domain:
redirect permanent / http://www.new_domain.co.uk
Multiple Pages to Single Page
You want all pages on your domain to redirect to the home page:
redirect permanent /* http://www.yourdomain.co.uk
You want all pages in ‘folder1’ to go to a single page ‘page.htm’:
redirect permanent /folder1/* http://www.yourdomain.co.uk/page.htm
You want all folders starting with ‘folder’ (eg ‘folder’, ‘folder1’, ‘folder2’, ‘folder345’) to redirect to ‘new_folder’:
redirect permanent /folder* http://yourdomain.co.uk/new_folder
Once you are happy with the changes, save the file and upload it to the root of your web site. Test thoroughly the changes by typing the old web address into your browser and making sure it redirects to your new page.
NB. Zeus servers are different to Apache however in that they cannot deal with redirects where the path name, that you are wanting to direct, contains file.php or file.html etc. ie if you try and set up the folder to page redirect as shown above but with a file name in it it will not work.
redirect permanent /index.php/folder1/* http://www.yourdomain.co.uk/page.htmwill not work.
We have searched the internet but cannot find the answer to this. If you know how to achieve this on a Zeus server please let us know.