I wonder just how many Tripawds Bloggers might consider upgrading with a Supporter subscription if they could have their very own custom domain mapped to their blog. And by that, I mean how many would like the idea of blogging about their pups at yourblog.com instead of yourblog.tripawds.com.
The answer will determine whether or not we implement the Domain Mapping plugin from WPMU Dev Premium here. It integrates with the Premium Supporter plugin we use, and would enable Tripawds Supporters to enter their registered domain name and have their blog appear online at that address instead of here at theirblog.tripawds.com. Domain registration would be necessary of course, with just minor edits to the DNS record at the registrar.
So, really cool new feature? Or, more hassle than it’s worth?
In the meantime, I’ll explain what I did to redirect our parked domains to this WPMU install. Any WordPres MU site admin who searched and found this post may now be saying, “You can’t do that” and they are right. That’s why we’re considering the Premium Domain Mapping plugin. At which point they may now be saying, what about Donncha’s free WordPress MU Domain Mapping plugin? Well, as I mentioned, we’re considering adding this to our list of Supporter Blog features. But there I go digressing again …
How to Redirect Parked Domains to WMPU Site
After discovering that our parked domains were redirecting to the WPMU sign-up page instead of the primary blog index as expected, I searched the WordPress MU support forums and discovered that this was actually expected behavior after all. So I did some homework and figured out a work around.
Remove parked domains…
The first thing to do when redirecting parked domains to a WPMU site is to unpark them. Access your your cPanel account and remove the parked domains you want to redirect to your primary blog, assuming they are already parked there.
Next, click the Addon Domains button in your cPanel account. Here you will create add-on domains for all those you have registered and want to redirect to your primary blog.
Once you have added the domain, return to Addon Domains and select Manage Redirection. Redirect the new domain you just added to the root of your primary blog (or wherever you desire) and click Save. That’s it!
You will notice in the screenshot that I renamed the file directories in my document root to keep folders for all the addon domains nice and tidy together. They will all reside in the public_html directory where you installed WordPress MU.
This method proved quick and simple for me. And you will now notice that tripawds.org and tripaws.org now both successfully redirect to tripawds.com. It’s a workaround, and it’s not true domain mapping as you will notice in the address bar, but it does the trick for us. If more than a handful of members are interested in upgrading to have custom domains for their blogs, I can just remove these Addon domains and install the Domain Mapping plugin.
How to automatically redirect web pages
Another option I considered before figuring out this workaround, was to set up hosting accounts for the parked domains and add static pages for auto redirection. Below are a few methods for doing that if anyone is so inclined.
Manual URL Redirect…
The simplest way to redirect visitors from any web page to another is with a manual URL redirect, forcing them to click a link to proceed:
Please follow <a href="http://www.example.com/">link</a>!
Redirect Domain using Refresh Meta tag…
Using the “meta refresh” method, it is possible to specify the URL of the redirect page, thus replacing one page after a specified time by any other. A timeout of 0 seconds means an immediate redirect:
<head>
<meta http-equiv="Refresh" content="0; url=http://www.example.tld/">
</head>
Auto-Forward web page using PHP…
In PHP, header() is used to send a raw HTTP header to the browser. Using the location function, this can be used for auto-redirection. Note that header() must be called before any actual output is sent:
<?php
header("Location: http://example.tld/");
?>
Redirect web site using .htaccess…
There are many methods to redirect a web site using the .htaccess file. Adding this to the .htaccess file of the domain you want forwarded is the most basic:
# redirect entire website to another domain
Redirect 301 / http://example.tld/
Permanent redirect HTTP Status C0de 301…
Adding the HTTP 301 Status code to any web page before the opening <head> tag will result in immediate and permanent redirection:
HTTP/1.1 301 Moved Permanently
Location: http://www.example.org/
Content-Type: text/html