htaccess 301 Redirect

File Redirects Illustration
File Redirects Illustration

The htaccess 301 redirect is the best search engine friendly way to redirect URLs on an Apache server. Here's how to make them easily.

  • Create a file with a plain text editor and name it .htaccess.
  • Put your redirects in the the file and upload to the root directory.

301 Redirect Code Examples

Redirect 301 /old-page.html /new-page.html
Redirect 301 /old-directory/ /new-directory/