Skip to content

Instantly share code, notes, and snippets.

@eugenoprea
Created February 10, 2014 12:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eugenoprea/8914758 to your computer and use it in GitHub Desktop.
Save eugenoprea/8914758 to your computer and use it in GitHub Desktop.
This code will redirect all pages to the homepage, while still allowing you to access the admin area.
# BEGIN redirect to homepage
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js|php)$
RewriteCond %{REQUEST_URI} !^/wp-admin [NC]
RewriteRule .* / [L,R=301]
#END redirect to homepage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment