• Hi,

    I was recently asked to look at wordpress website, fix some things, and move domain. I have no wordpress experience, but some Linux, php, mysql, HTML knowledge.
    I’ve set up site copy on my computer, basically used “moving wp” guide. Then set up git repository to track changes, and git-ftp to push my changes to production when I’m happy with what I have locally.
    One of the problems – wp site uses custom theme with loads of absolute url’s in source code and CSS files. So local site drags content from production site, which will soon move. How do I handle those url’s, if I replace them with absolute url’s pointing to local copy and push changes – production site will break. And what about moving site to new domain, I’ll have to update those links all over again in source code.

    I hope someone will make sense of this, what is your advise?

Viewing 1 replies (of 1 total)
  • Well done.
    I use a plugin called “DUPLICATOR” to look after the “moving wordpress” issues, it does an excellent job of managing trhe URLs in the database.
    Unfortunately it won’t manage the URLs in your .css or .php files.
    A) For your .php files, you could put the URL into a variable (or define) in your wp-config.php and then modify your source files to incorporate it on the fly.
    B) For your .css files (and .php too if you don’t want to do step “A”) you could use a macro pre-processor to substitute the URLs as required. Your maintain your theme and plugin files which have coded rather than absolute URLs. A makefile, or GIT or some mechanism produces for you a set of files which are customized for your different URLs.

Viewing 1 replies (of 1 total)
  • The topic ‘How to handle absolute urls in staging copy, with git-ftp push to production?’ is closed to new replies.