The content of this document may be incorrect or outdated.
Print this article Edit this article
Using .htaccess to redirect a web site on Apache
As web sites are migrated off of legacy servers it's important to establish a system to ensure visitors get to the new location. This can easily be done by creating a .htaccess file in the top level of your old web site. The .htaccess file should include the following commands:
RewriteEngine on
RewriteRule ^(.*) http://engineering.purdue.edu$1 [R=301,L]
These commands tell the web server that all traffic to your site should be directed to engineering.purdue.edu, if you are migrating your site to a different server the domain name should be altered.
The R=301 tells browsers and search engines that this move is permanent, which will result in search engines updating their indexes to refer to the new location.
Last Modified:
Apr 14, 2022 11:56 am America/New_York
Created:
Aug 22, 2008 9:13 am GMT-4
by
admin
JumpURL: https://eng.purdue.edu/jump/96be0
Categories
- Knowledge Base > Web > Apache