As the question says really, How can I make WordPress redirect all requests to subdomain.domain1.com to www.domain2.com.
I have a wordpress site on windows azure – I’ve added the below to the htaccess file but nothing seems to be happening:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)subdomain.domain1.com/$ [NC]
RewriteRule ^(.*)$ http://www.domain2.com/$1 [R=301,L]
Change your rule to:
WP permalink settings
The following is the comments summarised into the answer:
For wordpress sites hosted on on azure (and therefore in IIS) you dont use the htaccess file for rewrites, you actually need to add a web.config as described here http://www.davebost.com/2013/07/11/moving-a-wordpress-blog-to-windows-azure-part-5-moving-from-a-subfolder-to-the-root
The following rewrite rule would achieve the required result: