Skip to main content

Redirect request examples in Apache. More examples here.

# SEO 301 Redirect Single File
Redirect 301 /d/file.html /ddd/file.html

# Redirect Home to new Domain
Redirect 301 / http://www.htaccesselite.com

# 301 Redirect multiple files
RedirectMatch 301 /blog(.*) /$1

# Redirect Entire site to single file (302 = temporary redirect)
RedirectMatch 302 ^/ /temporary-offline.html

# Redirecting site for maintenance (/snippets/view/apache/redirecting-site-for-maintenance-in-apache)
RewriteEngine on
RewriteCond %{REQUEST_URI} !/maint/index.html$
RewriteRule $ /maint/index.html [R=302,L]