WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] convert subdirectories to subdomains (18 posts)

  1. Derek Fox
    Member
    Posted 3 years ago #

    I have setup my network and been running it for a while.

    http://thedigitalfox.com
    http://thedigitalfox.com/wordpress
    http://thedigitalfox.com/installwordpress

    I would like to now convert them over to subdirectories

    What is the process to do that with out reinstalling everything?

    Thanks everyone for your support and help.

    Derek

  2. In your wp-config.php file, there's a line that says Subdomains and it's set to 'false' right now. Change it to true and your site will flip over.

    Now that said... You may want to consider .htaccess redirecting the old URLs to the new ones. But it should work just that easily.

  3. gbrown88
    Member
    Posted 3 years ago #

    Hey,

    Looking to do that same thing. An suggestions on using .htaccess to redirect the old URLs to the new ones?

    Thanks
    Grant

  4. In your wp-config.php file, there's a line that says Subdomains and it's set to 'false' right now. Change it to true and your site will flip over.

    New sites, but not existing sites.

    You'll have to fix the addresses on all the old sites to subdomains.
    you'll have to update any links.

    and yes, you will have to update the htaccess file as well.

    tho we do state here in the forums it can be done, and provide instructions, this was mostly for the benefit of users who had picked the wrong option on install, and did not have live sub-sites to worry about.

    Changing over live existing sites on the network is not such an easy prospect. Do-able, yes. easy? Not so much.

  5. gbrown88
    Member
    Posted 3 years ago #

    I would never try anything easy! :) haha

    I'm trying to make sure I completely understand everything before attempting it later tonight.

    1. BACKUP everything. ha
    2. Switch from False to True.
    3. Fix the addresses for all the sites. I'm assuming thats under the Super Admin settings?
    4. Use .htaccess to redirect all old URLs to the new ones.

    Thanks
    Grant

  6. 2b. update htaccess file with subdomain rules. ;)

    and for step 3, under Super Admin, Sites.

  7. And step 4 you want stuff like this ABOVE the wordpress code in your .htaccess

    # SubDomains
    RewriteCond %{HTTP_HOST} ^subsite.domain.tld [OR]
    RewriteCond %{HTTP_HOST} ^www.subsite.domain.tld
    RewriteRule ^(.*)$ http://domain.tld/subsite/$1 [R=301,L]
  8. gbrown88
    Member
    Posted 3 years ago #

    Thanks! I'll let you know how my adventure goes...

  9. gbrown88
    Member
    Posted 3 years ago #

    Hey, should the files upload path be changed from:

    http://www.xxxxx.com/xxxxx/files

    to

    http://xxxxx.xxxxx.com/files

    Thanks
    Grant

  10. No, that's fine.

    The /files/ stuff gets redirected anyway in the back end :)

  11. Wait, yes - you DO need to change the files uploads from the previous subfolder to the subdomain.

  12. DOH! I'm just epic fail on this one!

    Change http://www.domain.com/site/files to http://site.domain.com/files

    Too many X's ;) That's MY excuse!

  13. gbrown88
    Member
    Posted 3 years ago #

    Thanks! Everything went off with any problems, looks great! :)

  14. katiepoo
    Member
    Posted 3 years ago #

    Hey Nice People!

    I did a fresh install, enabled multisite, but had a brain freeze and chose the subdirectory radio button instead of the subdomain radio button. I changed the SUBDOMAIN line to TRUE in my wp-config.php and the URLS flipped over as promised.

    Am I correct in thinking I can now go ahead and create new sites without editing anything in .htaccess, since ther are no links or whatnot to be concerned with?

    Thanks!

  15. Should be fine. Just make sure you have the right .htaccess for subdomains in general! :)

  16. katiepoo
    Member
    Posted 3 years ago #

    where might I aquire the "right .htaccess for subdomains in general! :)"?

  17. And in the Network menu they show the same ones based on the SUBDOMAINS 'true' check.

Topic Closed

This topic has been closed to new replies.

About this Topic