I don't know whether it applies to your situation, but wouldn't it be simpler to just do a series of move operations in your FTP client?
- Create directory
/public_html/old/
- Move everything except for
/public_html/wp
into /public_html/old
- Move everything from
/public_html/wp
up one level
done!
You'd have to be very careful when doing the moving of course.
If that won't work, I don't know what kind of hosting environment you are in, but the easiest way to do would be to map your domain to public_html/wp
instead of public_html
. That can't be done in .htaccess
though, you will need some kind of access to the site's setup.
In .htaccess
, you will probably have to use a mod_rewrite
rule that could look something like this (I can't test this right now so no guarantees.)
RewriteCond %{REQUEST_URI} !^/wp
RewriteRule (.*) /wp/$1?%{QUERY_STRING}