.htaccess Tutorial - Redirect Pages
Redirection is used to have visitors who request a page that no longer exists
redirected to another web page.
1. Create the .htaccess file
Let's say you remove file old.html and want to send people looking
for it to web page new.html.
Redirect /old.html http://your_domain.html/new.html
|
|
All it takes is one simple line, quick and easy.
An additional option is available. This is said to be the
best way from a search engine point of view.
Redirect permanent /old.html http://your_domain.html/new.html
|
|
The only difference is the error code generated while redirecting the request.
It indicates the requested document has moved for good and will not be back.
2. Other uses
This .htaccess feature can be used for any file type.
Redirect /old.pdf http://your_domain.html/new.pdf
|
|
This will redirect requests for old.pdf to file new.pdf.