Common Redirects With Htaccess

Last modified: 
Friday, March 27th, 2015

Managing some common redirect scenarios with mod_rewrite and htaccess.

301 Moved Permanently

Redirect individual pages

Redirect 301 /old.html http://www.example.com/new.html

503 Redirect a page.html to error503.html

RedirectMatch 503 ^/page.html$
ErrorDocument 503 http://example.com/error503.html
Header always set Retry-After "300"  

References

How can I return a 503 status in apache without invoking external scripts


The operator of this site makes no claims, promises, or guarantees of the accuracy, completeness, originality, uniqueness, or even general adequacy of the contents herein and expressly disclaims liability for errors and omissions in the contents of this website.