Server-side redirects: .htaccess versus Meta Redirects
(Page 1 of 6 )
URL redirects are needed for a number of reasons. One example is when you have changed significant portions of your website, and then have to deal with the problem of people finding their way from the old pages to the new pages. There are different ways of redirecting pages, through Meta tag http-equiv, JavaScript or any of the server-side languages. And what’s more, you can do it through .htaccess, which is probably the most effective, considering the minimal amount of work required to do it.
Introduction to .htaccess
Firstly, htaccess (Hypertext access) is an Apache HTTP server command file. Also referred to as “distributed configuration files,” it provides a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory. The directives apply to that directory, and all the subdirectories thereof.
There is a huge range of tasks that .htaccess can handle for web sites including: custom error pages, password protection/authorization for a specific directory, enabling SSI (server-side includes), blocking users by IP, blocking bad bots, changing default directory pages, preventing a directory listing, redirects and adding MIME types.
The best way to redirect from old or dead links is to use these server-side redirects. Most web servers will allow the use of .htaccess which facilitates this process. It is quite simple to edit and perform a number of tasks.
The important aspect is not to delay the surfer as they will be impatient. Nobody likes to wait for a page to load and a "Page not available" result will lose the visitor.
The usual and quickest way before server-side redirects was to add a HTTP refresh. Search engines are not too fond of the code and that page might be removed from the search engine index. That is something that you definitely do not want as a business or freelancer. Usually, this happens if you use a refresh for less than 10 seconds.
Next: How .htaccess can help you: Custom Error Pages >>
More JavaScript Articles
More By Stephen Davies