Support » Plugins » Hacks » A very complex or simple?: One WordPress with many domains

  • Somehow the modern book of answers (google) failed me for the very first time, i will come back to why in a sec.

    It first started with an opportunity given to me, some guys needed help with their wordpress site.
    Sure I make websites in wordpress and know some basic html & css but nothing too advanced but OK i said! no problemos.

    Ususally, your own problem has already been someone else problem before it was a problem for you. (i thought)

    So .. I’ll google it!

    After some intense research a friend calls me and I’ll decide to ask my friend for a solution.

    I tell him:
    I got this really complex problem. I need different domains on each post category for my blog!:S

    He tells me:
    – LOL thats really easy! You just go to permalinks and pick a name for each category! xD

    My answer:
    …. ehm. -.-

    – I have one primary domain (
    – and 3 more domains. ( ( (
    – One wordpress installation (newest).
    – 3 post-categories containing articles (posts)
    – Pretty permalinks

    I use the blog for writing superman, batman and peter-griffin articles ,
    (as 3 post-categories)

    But I wanna make use of my domains
    ( ( ( instead of etc etc

    Having domains for each category, working prettylinks and NOT using multisite, I told my friend.

    Beacuse when I did my google research the resluts get mixed up with setup multisites with different domains – in my case there is a single WP installation (not multisite).

    My friends answer: GL HF

    I did understand I could make use of .htacess and I also read some about redrict / rewrite but its not really clear.

    1. What solution fits my problem? (i need to keep pretty permalinks)
    2. How to point the other domains? if I have the domains at same hosting company as WP install
    3. How to point the other domains? if I have domains at other regstar.

    I am very muchos grande appreciated for your very assistance in this matter!

    PS: sorry to dissapoint but im not really writing a superman blog.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz


    It should not matter who your domain registrar is, you alter the domain’s DNS record to point to your actual server. If you cannot do this you need to move your domains to a legitimate registrar as soon as you can.

    How to alter your DNS record would depend on your registrar. First determine from your host what the proper IP address is for your server. Log into your domain account and find something about editing DNS Zone File. Edit the ‘A’ record to point to your server IP. Depending on the TTL setting, traffic to your domain should be soon directed to your server.

    If your host is also your registrar, everything should be setup for you, but you could look at your zone file to confirm the A record is correct.

    You can rewrite URLs in .htaccess, but this may not work well for you. Since you are changing domains and not just server paths, the rewrite appears in the user’s browser and the status is returned as 302 instead of 200. At least I think so. You might do a test to be sure because this would otherwise be an easy solution.

    The Rewrite API will not be of much use because it only deals with the request string which does not include the domain portion. As far as accessing posts, you don’t really need the category argument anyway, the slug alone will retrieve the post. The issue is more for category queries which should appear to the user as a home page for superman or whomever. In this case use the ‘pre_get_posts’ action to extract the category from the domain contained in $_SERVER['HTTP_HOST'] and set the ‘category_name’ query var.

    There may be all sorts of other issues, but this takes care of at least the basics. Resolve each issue when encountered and you should get it all working eventually.

Viewing 1 replies (of 1 total)
  • The topic ‘A very complex or simple?: One WordPress with many domains’ is closed to new replies.