简体   繁体   中英

Pass through wordpress Folder to root folder

I have a wordpress installation on a site. It was placed inside ~/wp.

I've moved it yesterday to the root folder, ~/. However, a lot of the theme references and images still point out to ~/wp.

Instead of finding all these places(which may be hundreds), I'd like to pass through ~/wp to the root folder. Meaning, when the user goes to http://www.site.com/wp/thing.php , he'll actually be inside ~/thing.php, without changing the url.

Would this be possible with .htaccess changes? and if so, how?

It's a config setting - in Settings -> General you are given two options, WordPress Address (URL) and Site Address (URL).

You have the former pointing at the directory with the Wordpress installation in it and the latter at the root of your site.

Here's the Codex info on it;

http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install

Incidentally, modifying all the files paths is another option of course - you would use the same technique you would use when transferring a Wordpress site from localhost to live, or from a dev server to live. You can look at the second part of my answer in this thread;

How to push wordpress from mamp into hostgator

That interconnectit script is a huge timesaver when moving WP sites.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM