Move WordPress to subdirectory, keep ALL URLs

I currently have a website at site.com and have WordPress installed in me website’s root folder. My website includes pages like:

  • site.com
  • site.com/page
  • site.com/2015/10/01/post….
  • site.com/login
  • site.com/wp-content/uploads/…

I would like to move all WordPress files into one subdirectory for sanity and NOT CHANGE ANY publicly facing URLs. Other posts here and and the official support thread talk about “Giving WordPress its own directory” but require changing URLs:

  • https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory (site.com will load the homepage, but all other publicly facing URLs change)
  • Move wordpress to folder without changing urls (similar question but talks about install multiple blogs)

Please advise if this is possible.

3 s
3

The procedure is thoroughly documented in Codex under Moving a Root install to its own directory.

You misunderstand the point about changing URLs in it, and yes the terminology sucks. The only URLs that will change are those that are based on the “WP address”. That would be WordPress core, essentially the admin area.

All content URLs are based on “Site address”, following this procedure, that will still be the root of your site.

Since you want to retain uploads in place, you can do that by keeping wp-content in the root (splitting it out of core folder) and adjusting configuration for that. See Moving wp-content folder.

Leave a Comment