0

I had a demo environment set up in /subdirectory/ and then moved it to my root directory to make the site live.

  • Used the wp migrate db plugin to export my database with the new paths, then replaced all the database tables with my new export.
  • I did a search and replace in PHPmyAdmin and replaced /subdirectory with /, just to make sure nothing was missed.
  • Copied all the content from /subdirectory to my the site's root

Upon doing this, my site worked at the root URL, however, I noticed that the bloginfo('template_directory'); and get_template_directory_uri(); functions get the old URL! (/subdirectory/wp-content/themes/my-theme/).

If I remove the /subdirectory/ files, the site doesn't load (I just see a blank page).

I went to my index.php to check on where wp-blog-heaer.php was being loaded from, making sure that it was referencing my root directory.

I also added

update_option('siteurl', 'http://www.mysite.com' );
update_option('home', 'http://www.mysite.com' );

to both wp-config files.

I even used the Search and Replace Database Script recommended in the Wordpress Codex to make sure I didn't miss anything in the database like serialized strings.

Can't decipher why my site still thinks that it's in the old URL. Any ideas?

edit: My root .htaccess seems fine also. No mention of /subdirectory

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
4
  • Have you checked your .htaccess? Commented Oct 17, 2013 at 23:09
  • Just checked my root .htaccess, nothing in there that points to my subdirectory (added to my question).
    – Orun
    Commented Oct 17, 2013 at 23:21
  • Both wp-config files?
    – s_ha_dum
    Commented Oct 17, 2013 at 23:25
  • Thanks for mentioning that! I just checked both wp-configs and found the issue. Will post it in an answer, but basically I overlooked a define( 'WP_CONTENT_DIR' line. DERP.
    – Orun
    Commented Oct 17, 2013 at 23:31

1 Answer 1

0

Silly mistake on my part,

At some point I defined my wp-content directories right in wp-config.

define( 'WP_CONTENT_DIR', '/home/user/public_html/site/subdirectory/wp-content' );
define( 'WP_CONTENT_URL', 'http://www.seocial.ly/site/subdirectory/wp-content' );

Completely overlooked this when editing my wp-config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.