Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm already running a WordPress installation just fine under a mapped domain. The current setup points (www).sample.com to /sample/ within domain.com, and it works fine. In the Create A Network section of the WP Codex, it states "Domain mapping, however, will not work" but I would like to know if it is possible to make this installation into a network by manually editing the .htaccess file or some configuration somewhere. I feel like this should be possible, I can't see a reason why it couldn't be done, it's just complicated. Any input would be greatly appreciated.

share|improve this question
    
I'm a little confused by your terminology. Domain mapping in WordPress refers to the Domain Mapping plugin. Can you explain your setup a little better? does (www.)sample.com redirect to domain.com/sample/ or does the user remain on sample.com? –  Matthew Boynes Feb 12 '12 at 3:45
    
The user remains on sample.com. I'm referring to domain mapping in general, nothing to do with WordPress at all in this instance. I simply want to turn the existing site into a Network, which doesn't work under my setup out of the box. –  alanaktion Feb 12 '12 at 4:22
    
Thanks for clarifying that. Can you explain your setup a little more? How are you "mapping" sample.com to domain.com/sample/? Are you using a virtual host? htaccess? proxy? –  Matthew Boynes Feb 12 '12 at 4:29
    
@MatthewBoynes I'm using htaccess to point the domain to the subdirectory. RewriteCond %{HTTP_HOST} ^(www\.)?sample\.com$ RewriteCond %{REQUEST_URI} !^/sample/ RewriteRule ^(.*)$ sample/$1 [L] I'm certainly open to input on changing something here, too. –  alanaktion Feb 12 '12 at 5:08
add comment

2 Answers

This is possible, and it actually should be very easy for you to do.

There are lots of ways that you could have this setup, depending on if your server is using cPanel, Plesk, etc. At its most basic, right now, your Apache virtual host points to your main web directory, maybe something like /var/www/, and you have your htaccess file routing the domain to a subdirectory of that. What you need to do is change your virtual host to point to the directory in which WordPress actually resides instead of its parent directory. You'll want it to look something like this:

<VirtualHost *:80>
    ServerAdmin your@email.com
    DocumentRoot "/var/www/sample"
    ServerName sample.com
    ServerAlias *.sample.com
</VirtualHost>

How you do that will depend on your server's software if applicable. If you don't feel comfortable making changes to your server config, you should consult your web host and I'm sure they'd be happy to make this edit for you.

Cheers~

share|improve this answer
    
As far as I know, I don't have the ability to use VirtualHost on my server, as it's shared hosting, but I'll look into it. If I had a dedicated server, this is certainly what I'd do. –  alanaktion Feb 12 '12 at 6:23
    
Even shared hosts are setup this way, but you'd just have to access it in a slightly different way. Who is your host? –  Matthew Boynes Feb 12 '12 at 6:24
    
I'm using GoDaddy. –  alanaktion Feb 12 '12 at 16:07
add comment

The first site in multisite installation will have /blog pre-pended to all permalinks. So its a bad idea to convert your existing site to a multisite installation. I suggest creating a new multisite install with domain mapping enabled. Then add a site to your network. When you do that it will create a bunch of tables like these:

wp_2_commentmeta | | wp_2_comments | | wp_2_contact_form_7 | | wp_2_links | | wp_2_options | | wp_2_postmeta | | wp_2_posts | | wp_2_term_relationships | | wp_2_term_taxonomy | | wp_2_terms

You want to replace these tables with the ones in your current blog. That would be a rename table operation in phpmyadmin. Rename and move the tables over to the multisite database.

Finally move wp-contents/uploads and any plugins and themes from your current blog to your multi-site install.

BTW you can have multi-site on a shared hosting account. Just make sure the document root of any multi-site domains is set to the multi-site wp installation directory.

share|improve this answer
    
I'm not sure you understood what I meant. The entire WordPress installation is under a sub-directory on my server, which is mapped to a new domain. I don't want to map the sites within the Network, I intend to use the 'paths' option. The problem lies in getting a Network to install correctly. –  alanaktion Feb 12 '12 at 16:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.