• Resolved Pru

    (@pru)


    My host told me I could do a dev copy of my WP site on a subdomain, so I made dev.mysite.com and copied everything over including a copy of the database. I edited the WP config to the new DB and restricted access to just my IP.

    Turns out this works fine until you try to go to dev.mysite.com/wp-admin and login. The login redirects you to the main domain, mysite.com, so you cannot admin your dev site.

    I’ve seen a couple of solutions for this that are more like hacks, probably outdated, involving mass search and replace on the raw database. I want to avoid that sort of thing.

    Is there a simple solution for this that doesn’t involve hacking code? Maybe a one-liner?

    Surely others are doing dev work on copies of the live site on the same host?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator cubecolour

    (@numeeja)

    You need to change the site URL in the database for the dev version of your site
    http://codex.wordpress.org/Changing_The_Site_URL

    Due to the way some data containung URLs may be stored as serialized data in the database, in my opinion the best way to change all instances of the site URL is to use the interconnect search & replace tool from http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    Thread Starter Pru

    (@pru)

    Thank you! That first link worked, but when I tried the tool, it jacked up the site. I noticed this when one of my post images disappeared. I looked in the raw html and the css on the image had a class like “weroizsfjkjwer”–totally random–so I dropped the database, re-imported a fresh copy, changed the two URLS in wp_options and the post image looks fine.

    I think that tool, which dates from 12/2011, may not be compatible with recent versions of WP?

    Moderator cubecolour

    (@numeeja)

    The tool works fine for me – I used it yesterday with no problems & have never had problems with it before.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘dev site on subdomain prevents admin login to subdomain’ is closed to new replies.