Support » Fixing WordPress » Add-On Domain without copying the whole blog to new folder

  • Hi,

    I need to use an add-on domain (new domain) with my site. I want to have all posts and files to be shown as for the main domain. ex. becomes

    As fars as I found on the web, add-on domain will create a new folder on its name. This folder will have to contain all files and folders to function normally! How ever it is time and space wasting to copy every thing two times. I refused to do it.

    I was wondering if there is a way to use some kind of redirectiing, .httaccess or simmilar things to just show the address as for nem domain.

    The reason, some countries have filtered my political site, I need to use some mirrors, so it is important to not to have any sign of the main domain on it. I was not able to sort it out by myself, please lead me.


Viewing 13 replies - 1 through 13 (of 13 total)
  • I have thought of a similar idea. Then I tried to add the following in wp-config.php and it works.

    $hostname = $_SERVER['SERVER_NAME'];
    $hostname = str_replace('www.', '', $hostname);
    if ($hostname == '') {
    define('WP_SITEURL', '');
    define('WP_HOME', '');

    Oh, forgot to mention. I use domain pointers. Set to point at

    Thanks for reply poppacket.

    Please let me know where exactly put the codes? Before and after what line?

    I did not understand of the pointer! I put the name servers to point at my host IP and it works fine. The problem is, how to set an add-on domain to show up the posts in main domain.

    I would be greatful if you could give me step-by-step insrtuctions about how to set an add-on domain, what to put inside its newly created folder, whst to do about redirecting and so on


    $table_prefix  = '3p8e4k_';   // Only numbers, letters, and underscores please!
    // Change this to localize WordPress.  A corresponding MO file for the

    Depending on your control panel, domain pointer also known as domain parkin. If you are using CPanel, you can add the domain in in Parked Domains. Another thing worth of note, it is only possible if your host allow domain parking/domain pointing. Usually its a free feature.

    Hi poppacket.

    Thanks for your advise but it is not what I wanted. I tried it but it just redirects me to the main site.

    I want to get rid of the main domain in addressbar. It is a “must” for me.

    I use CPanel, I did as you have said and it was not what I wanted.


    Yes you can “get rid of the domain in addressbar”.

    Have a look at my site:

    It should work unless something went wrong somewhere.

    It is fantastic, what was wrong with mine?

    Lets say:

    1- have
    2- buy
    3- Add as Parked Domain in
    4- Redirect to to
    5- Put the codes in wp-config.php as described above
    6- and, It must be working now..

    All I did was the same.

    I have to add that my site has many wordpress installed on, different folders (subdomains) and loads of files. All I need to do is to replace with in every thing. I do not want to copy them in a new folder, because I will have to post every thing twice!

    I was told that add-on domain will be the best solution, I tried with no victory. I come up with your suggetion, was not successful!

    Please tell me what did I do wrong?


    Don’t redirect (as per #4). Just add in Parked Domain to

    Domain parking will let you to access any file at using the domain.


    You have a file:

    You can access this file at

    If you redirect, to, it will only redirect[whatever here] to That’s the basic idea. So remove redirection. [whatever here] can be anything or even empty.

    Good luck.

    poppacket thanks, it worked and I found the fault was from my side.

    1- Redirection must be disabled, it is done now
    2- Parked domain seems to not likeing subdomains
    3- Folders are OK but Subdomains goes back to
    4- My root index.html was a redirection to yeraly made blog, it was the problem of duble redirection for
    5- It is half done

    Any idea to how to set subdomains work under


    If your host allow to have multiple domain, you can do like I show here. I am not so familiar with CPanel. I ditched it long time ago and using DirectAdmin now. But it’s worth trying.

    1. Backup all the files in (Just in case you lose it)
    2. Add in Add-on Domains and point it to the directory of

    Only if that does not work,

    3. Delete in Add-on Domains
    4. Delete in Subdomains
    5. Add in Add-on Domains
    4. Add in Parked Domains pointing to
    5. Restore the backedup files earlier to directory of

    Again, it will only work if your host allow add-on domains.

    thank you vey much, I have done it almost, with your helps ofcorse.

    Now, have another issue! There is “permalink” problem on blogs! It seems the code above does not push the wp-config.php to change the address from to

    I have to use nice URL because my translating software does not like wordpress ID numbers for posts.

    Now, evry thing works but the permalinks which makes whole blog useless with new domain. If reader wnats to open a post to read it all, it opens the version.

    I tried to play with “Options” in Admin Panel by putting several types of addresses, but it messed whole blog, I had to go to Php MyAdmin to fix it!

    Any way, I am glad to have your helps and friendly advises.


    I am glad that it worked for you, too.

    As for the latest problem you encountered, I am not sure what was wrong. If you look at my site, the nice URL work. I use nice URL for permalinks.

    Unless you insert a permalink manually (i.e. inserting Link), there shouldn’t be any problem.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Add-On Domain without copying the whole blog to new folder’ is closed to new replies.