Forum Moderators: phranque
[edited by: g1smd at 10:08 pm (utc) on Sep 19, 2011]
# 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]
#
#
RewriteCond %{HTTP_HOST} !^example2\.com$ [NC]
RewriteRule (.*) http://www.example2.com/$1 [R=301,L]
#
#
RewriteCond %{HTTP_HOST} !^www\.example2\.com$ [NC]
RewriteRule (.*) http://www.example2.com/$1 [R=301,L]
#
#
RewriteCond %{HTTP_HOST} ^example2\.com$ [NC]
RewriteRule (.*) http://www.example2.com/$1 [R=301,L]
</IfModule>
# END WordPress
If the domain is not www.example2.com, redirect to www.example2.com/SomePageSo, the first rule (of those two) redirects if the requested host name is not www.example2.com. It will therefore redirect requests for example2.com - which is what you want.
If the domain is example2.com, redirect to www.example2.com/SomePage
RewriteEngine On
#
RewriteCond %{HTTP_HOST} !^(www\.example2\.com)?$
RewriteRule (.*) http://www.example2.com/$1 [R=301,L] [edited by: g1smd at 3:27 pm (utc) on Sep 20, 2011]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#
#
RewriteCond %{HTTP_HOST} !^(www\.example2\.com)?$
RewriteRule (.*) http://www.example2.com/$1 [R=301,L]
# END WordPress
# BEGIN WordPress
RewriteEngine On
#
RewriteCond %{HTTP_HOST} !^(www\.example2\.com)?$
RewriteRule (.*) http://www.example2.com/$1 [R=301,L]
#
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#
# END WordPress
[edited by: g1smd at 4:03 pm (utc) on Sep 20, 2011]