Simple Redirects with .htaccess
Redirect Syntax
This is the basic syntax for redirects written using the mod_alias redirect directive in Apache:
Redirect [status] URL-path URL
- Make sure you capitalize the
R
inRedirect
or it won’t work. Everything is case sensitive. - The status is optional and is usually a number indicating the HTTP status code you want to deliver to the browser. You can use the word
permanent
in the place of301
, ortemp
in the place of302
. If not provided, then302
will be used as the default. - The URL-path is required and is always a path relative to the site root, not the location of the
.htaccess
file. - The URL is required and is either a path relative to the site root, assuming the redirect is within the same site, or an absolute URL if the redirect points to another site.