One of my clients has a Wordpress site that is a multisite installation. They are running a new campaign that I have set up as a page under the main site at example.com/summer/
. However, they sent marketing materials to print that list the URL as summer.example.com
. Is there any way to redirect that subdomain to the proper page without having to set up a whole new multisite?
I tried sending the A
record of the subdomain to the IP address of the site. Then used .htaccess
and added the following lines:
RewriteCond %{HTTP_HOST} ^summer\.example\.com
RewriteRule ^(.*)$ https://example.com/summer/$1 [R=301]
That redirects the subdomain to example.com/wp-signup.php?new=summer
Any ideas?
Update:
I've added the wp-config
definition of ('NOBLOGREDIRECT', '%siteurl%')
which gets summer.example.com
redirecting to example.com
. This is not the fix I need, but just reporting back on potential fixes I'm seeing around.