Have multiple sub-domains we want merge into the main domain, but maintain url structure (just chop off the subdomain and deliver a 301):
subA.domain.com/post-titleA/ TO www.domain.com/post-titleA/
subB.domain.com/post-titleB/ TO www.domain.com/post-titleB/
We also want to be adding WWW to the url if absent:
domain.com TO www.domain.com
We also need to maintain the Wordpress rewrite rules currently in place
.htaccess file is currently:
- Code: Select all
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I have seen the following code accomplish the sub.domain.com TO www.domain.com 301 redirect but need to two to work together:
- Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ http://www.getelastic.com/$1 [R=301,L]
Any help making this hum would be appreciated.