Last active
December 16, 2015 14:59
-
-
Save huntlyc/5452316 to your computer and use it in GitHub Desktop.
Custom redirects with WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Domain Redirect | |
<IfModule mod_rewrite.c> | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^(www\.)?huntlywordpress\.co\.uk$ [NC] | |
RewriteRule ^ http://www.huntlywordpress.com%{REQUEST_URI} [R=301,L] | |
</IfModule> | |
#EndDomain Redirect | |
#BEGIN custom redirects (single page) | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RedirectMatch 301 ^/contact\/$ http://www.huntlywordpress.com/contact/ | |
</IfModule> | |
#END custom redirects | |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> | |
# END WordPress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment