WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Domain Mapping MS subdirectory installations (31 posts)

  1. T B
    Member
    Posted 3 years ago #

    Hi,
    Already installed the WordPress MU Domain Mapping and usually work for me, but this is a subdirectory installed site with subdomain.
    It's a new situation and don't found the answer.

    The file and domain like this:
    /public_html/subfolder
    http://maindomain.com
    http://maindomain.com/subdomain mapping to
    http://newdomain.com

    Can anyone help for me?

    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  2. you have to make a server alias between the mapped domain and the folder multisite is installed in.

  3. T B
    Member
    Posted 3 years ago #

    I don't know a lot about "server alias" but I have found at hostgator this http://forums.hostgator.com/setting-up-domain-alias-t1339.html they called "domain alias" is that the same things?

    If yes, then
    1. The parked domain newdomain.com has been successfully created.
    2. I made a domain mapping by plugin.
    3. I changed the hostgator nameserver at name.com

    Not work yet, but is it ok?

  4. T B
    Member
    Posted 3 years ago #

    Something wrong...

    "If you wish to install WordPress in a folder AND have that folder name it will work. Domain mapping, however, will not work."

    and the server alias not work too

    "Step 2: Setting Wildcard Subdomains
    (If this is a Sub-directories Install, skip this step.)"

    http://codex.wordpress.org/Create_A_Network

    Any other way to do that? Or do I need to install into the public_html directory?

  5. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    You cannot run a subdomain install in a directory. It has to be in the root of the website.

    If WP is installed in a directory instead of the root, domain mapping will not work because the mapped domain requests are sent to the root of the website rather than where WP is intalled.

  6. T B
    Member
    Posted 3 years ago #

    I thought.

    Many thanks

  7. mihai
    Member
    Posted 3 years ago #

    I managed to modify the domain mapping plugin to work in a subdirectory install.
    You can find the patch and some configuration instructions here:
    http://patchlog.com/wordpress/wpmu-domain-mapping-in-subfolder-install/

  8. T B
    Member
    Posted 3 years ago #

    qool... where do I have to put the code?
    Can I insert anywhere in the domain mapping plugin?

  9. mihai
    Member
    Posted 3 years ago #

    No, sorry I forgot to mention how to use it. I assume most of my readers know how to use a .diff file.
    I have posted a zip file with the plugin already patched , check out the post again.

  10. T B
    Member
    Posted 3 years ago #

    What type of network does need, virtual subdomain or subdirectory?

  11. T B
    Member
    Posted 3 years ago #

    Ok
    The subdirectories not work(for me) then I made a new wp in the subfolder.
    This is a wp with ms Sub-domains - like site1.example.com and site2.example.com but when I want to create the domain mapping database table, then that message come up:

    Warning! This plugin will only work if WordPress is installed in the root directory of your webserver. It is currently installed in ’/a2_bumpkyn/’.

    May be I missed something... Any idea?

  12. mihai
    Member
    Posted 3 years ago #

    I'm using this with wordpress installed in a subdirectory but the blogs are configured to be subdomains of the main domain.

    If you're still getting that error you don't have the modified plugin active.

    Remove the version that you have now, download my zip file and extract it in the plugins directory.

    IF you have a file named domain_mapping.php in wp-content/mu-plugins.php then replace it with the domain_mapping.php file from the modified plugin... just move the file from the plugin directory to wp-content/mu-plugins.

  13. T B
    Member
    Posted 3 years ago #

    When I installed in the sunfolder, and try create network, then I get this: Because your install is in a directory, the sites in your WordPress network must use sub-directories.

    How do you create subdomain system of the main domain?

  14. Because your url is domain.com/something/.

  15. mihai
    Member
    Posted 3 years ago #

    When I created this and installed wordpress was at version 3.0 beta and there was no such message.
    I'll try to recreate it with a new install from scratch and come back with a possible solution tomorrow... probably another patch for wordpress. I see no reason why this would not work. It works just fine on my sites where wordpress is installed in a subfolder and I'm using subdomains.

  16. On many shared hosts, wildcard subdomains cannot be configured to work when the install is domain.com/something/. That's why.

    The message above I believe comes from the domain mapping plugin.

  17. T B
    Member
    Posted 3 years ago #

    "I'm using this with wordpress installed in a subdirectory but the blogs are configured to be subdomains of the main domain."

    I can't do this with 3.1.3.

  18. That's not supported in any version.

  19. lcrook
    Member
    Posted 3 years ago #

    Hello,

    I was looking at the text for the Domain Mapping plugin and it says it works with WP 3.0 as network. It also says that you can map sub-domains with the plugin such as http://www.techguys.com and macstuff.techguys.com. but reading over this thread it sounds like that is what Tib was trying to do but found out that it was not supported. Is this correct? I'm confused, because we were looking into doing this for our domain. We have 3.x installed as sub directories and we want to have just a few of the sub sites to have unique sub-domains but only just a couple of them out of the 30 something sites we plan to have running. Will Domain Mapping Plugin do this as described?

    Thanks!

  20. mihai
    Member
    Posted 3 years ago #

    Back! Sorry for the delay on this.

    I was able to replicate this with a small change to wordpress code. It's really just about removing a error that's probably there just because this thing might not work everywhere or more likely because it's a bit more complicated to do.

    @lcrook wordpress multisite with subdomains and domain mapping is working just fine out of the box but not ( without patching ) if you're
    installing wordpress in a subfolder of the main DocumentRoot folder ( the one that's usually called public_html or htdocs )

    @Tib you were right about one thing. The zip file I published still needed patches in 2 other places. It's fixed now, please download it again from http://patchlog.com/wordpress/wpmu-domain-mapping-in-subfolder-install/

    I posted detailed instructions about how to install WordPress 3.1.3 in a subfolder, enable multisite , add domains and set up the domain mapping plugin here:
    http://patchlog.com/wordpress/multisite-in-subfolder/

  21. mihai
    Member
    Posted 3 years ago #

    @Andrea_r "On many shared hosts, wildcard subdomains cannot be configured to work when the install is domain.com/something/. That's why."
    Can you provide more details about such a shared host? What makes it so "special"

    As far as I see it wildcard domains need to be defined in the virtual host ( apache or whatever webserver ) and in DNS. While some shared accounts will definitely not allow you to do that others will.

    But as long as the web server works with wildcard domains why would wordpress not work with it? I know the current version doesn't work but the limitation seems artificial ... like someone just thought "ah this is to complicated for users to understand so let's just block it"

    As soon as I removed that "artificial" block everything works if you just set the urls right in the domain settings.

    And btw you don't even need wildcard domains to have wordpress multisite and subdomains working. Some shared hosts will allow you to set multiple domain aliases on your account. Sure this means that for each new subdomain you add in wordpress you also have to add an alias in your hosting account's control panel.

  22. lcrook
    Member
    Posted 3 years ago #

    Thanks Mihai,

    We have wordpress installed in a wordpress folder at the public_html root folder, so as such then this plugin will not work?

    I am confused then, I thought that was a requirement for wordpress network as outlined in

    Create_A_Network
    . "Giving WordPress its own directory will not work in WordPress 3.0 with multisite enabled."

    Did I misunderstand that then and wordpress can in fact be installed as the root folder intself for a network install?

    Thanks!!

  23. mihai
    Member
    Posted 3 years ago #

    The official documents state that the multisite functionality of wordpress will not work IF wordpress is installed in a subdirectory.
    This also applies for the domain mapping plugin.

    But if you use the modified version of the domain mapping plugin and follow the steps I describe here http://patchlog.com/wordpress/multisite-in-subfolder/ you should be able to use your current install in a subdirectory with multisite and domain mapping.

  24. lcrook
    Member
    Posted 3 years ago #

    A-ha, I get it. I see that now. So wordpress multisite will work in a directory as long as it all remains in said directory. So you can install it in html_public or html_public/blogs/ if you wanted, just as long as you have all aspects of wordpress installed in that sub folder like you would in the root folder. What will not work however is the stated option of having only a few important files on the root and then the extra files in a subdirectory in effect "splitting" the wordpress install if you are using a network configuration. Excellent, thank you!

    So that helps me to really understand this all and that this plugin will work either way but may require patching if not on the direct root like the plugin probably expects!

    shazam, Thanks Guy!

  25. T B
    Member
    Posted 3 years ago #

    Ok! Sounds good, I am doing that!

    One more question... I don't know how did you install more "subfolder wp" if need to put in the root them "index.php and .htaccess from /home/example.com/public_html/wordpress to /home/example.com/public_html/"

    If I can't install more "subfolder wp" pnly one because of index and .htaccess, then why? :-)

  26. mihai
    Member
    Posted 3 years ago #

    @lcrook coping index.php and .htacess from the subfolder to the main folder is a requirement if wordpress installed in a subfolder.

    @Tib I don't understand your question. What do you mean by "more subfolder wp" ?
    Wordpress is installed only once in a subfolder then after you activate multisite you will be able to have multiple blogs , each having it's own subdomain name.
    Example: main site is example.com , wordpress is installed in
    DocumentRoot is /home/example/public_html
    Wordpress is installed in /home/example/public_html/wordpress
    subdomains dom1.example.com and dom2.example.com are blogs created in this multisite install.
    With domain mapping you would be able to map a full domain like dom1.com to a subdomain like dom1.example.com.

  27. T B
    Member
    Posted 3 years ago #

    :-) @mihai I would like install more WordPress MS in the subfolder, because I don't want to remove-update and move the subsites into the new site...

    /home/example/public_html/wordpress1 3.1.3
    /home/example/public_html/wordpress2 3.1.4
    /home/example/public_html/wordpress3 .....
    /home/example/public_html/wordpress4 .....

  28. mihai
    Member
    Posted 3 years ago #

    You could modify index.php ( the one from the root folder ) so it would include wp-blog-header.php from one of those subfolders based on the domain.

    So the code would be something like:

    $doms313=array('example1.com','example2.com');
    $doms314=array('example3.com','exmaple4.com');
    
    if(in_array($_SERVER['HTTP_HOST'],$doms313)){
    require('./wordpress1/wp-blog-header.php');
    }else if(in_array($_SERVER['HTTP_HOST'],$doms314){
    require('./wordpress2/wp-blog-header.php');
    }
    ....

    This should work but I think it's a bad idea to have so many versions working at the same time and especially old versions. There's a good reason why you should upgrade.

  29. T B
    Member
    Posted 3 years ago #

    That's true, but I like to leave alone some site... if finally work...

  30. T B
    Member
    Posted 3 years ago #

    What do you mean by "('example1.com','example2.com')" ?

    Do you mean?

    $doms313=array('Sub-directory1.com','subdomain1.Sub-directory1.com','subdomain2.Sub-directory1.com','subdomain3.Sub-directory2.com','subdomain4.Sub-directory1.com');
    $doms314=array('Sub-directory2.com','subdomain1.Sub-directory2.com','subdomain2.Sub-directory2.com','subdomain3.Sub-directory2.com','subdomain4.Sub-directory2.com');
    ....

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic