Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: When Wordpress is installed in a subdirectory but site addresses should be at the root #84

Open
ramaxfield-git opened this issue Oct 20, 2020 · 5 comments
Assignees

Comments

@ramaxfield-git
Copy link

Hello! Thank you for your earlier help - I've been able to get my single sites zipped up in preparation to move them into a multisite. However, my multisite installation is configured so that all the Wordpress files live in a /wp subdirectory, but the site URLs should wind up at domain.com/site1, domain.com/site2 etc. Should the migration command be run, and the .zip files to migrate located, in /wp or at the root? I don't want to get it wrong.

Thank you!

@nicholasio
Copy link
Member

Hi @nicklaussemuse it shouldn't matter, it should work both at the root and at the wp/ subdir. This tool relies on WordPress functions wp_uploads_dir and get_theme_root to figure out paths so as long as you have a working wp installation all should work fine.

I should note though that I haven't tested with this particular scenario, so should you encounter any issue, feel free to let us know.

@ramaxfield-git
Copy link
Author

Okay, interesting development! What happened when I ran the import command was that it simply made the temporary installation (at /wordpress_temp/site1) part of the multisite network. This was of course not my intent; I'd like it to exist at /site1.

Is this something that using the --new_url parameter will solve? I didn't include it because I thought that "perform a search and replace" would be something else, but if that would make it end up in the right place, that would be good. And further to that, I'm currently doing this on a server with a temporary address before we retarget our server.example.com url to the server currently located at new-server.example.com - so would I be able to write "--new_url=/single-site" without the "example.com" part of the parameter?

@ramaxfield-git
Copy link
Author

ramaxfield-git commented Oct 26, 2020

Just wanted to check in and see if you/someone else had any advice here. I tried installing with the flag "--new_url=/single-site", but it wouldn't do it - is my only option to do it in a hurry after we change the development server's URL to the one it's meant to be using (ie. make the site live without things being properly built and ready)? (Or if I install it at "--new_url=http://new-server.example.com/single-site", will it end up in the right place after that server becomes server.example.com?)

@splaquet
Copy link

folks can correct me on this one... but, if i'm following you, it might be easiest to push a 'wp search-replace 'old.url.com' 'new.url.com' --precise --network

but, on the --new_url= tag, you'd want either:
--new_url=subdomain.domain.com
--new_url='domain.com/subfolder'

@ramaxfield-git
Copy link
Author

@splaquet, the issue I'm referring to is that I'm importing these sites on a server that will be changing its address when the migration is complete. I want to avoid a situation where I import a site to TEMPDOMAIN.COM/subfolder, the server becomes DOMAIN.COM, and the site breaks. Because I don't know what exactly gets written where with that command and if a site imported at TEMPDOMAIN.COM/subfolder will still work at DOMAIN.COM/subfolder when the server currently operating as TEMPDOMAIN.COM becomes DOMAIN.COM - does that make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants