0

In the past my organisation has had some problems where a development copy of a site was cloned (through Installatron in cPanel) to a new hosting account, but the new (live) copy of the site had some absolute references to images or files on the development copy of the site.

This meant that when the development site was taken down, some things broke on the live site.

How can I make the development copy of the site offline, including images and other files, so that any absolute URLs referencing it from the live site don't work? This way when we do our go-live review of the live site, we'll see any problems before the development copy is removed. I don't want to delete the development copy of the site just yet.

A method that can be used through the front end of the site (WP admin or cPanel) would be preferable so that non-technical staff can do it too.

  • 2
    It's not a WordPress question really, but how about suspending the development host in cPanel? – Andy Macaulay-Brook Jun 9 '16 at 0:16
  • Both sites had the same domain? – kaiser Jun 9 '16 at 0:23
  • @kaiser no, we have a separate domain for development copies. – Highly Irregular Jun 9 '16 at 1:13
  • @AndyMacaulay-Brook I disagree. It is a WordPress problem as that's where the problem is seen, but doesn't necessarily have to be a WordPress solution (I just need a solution). The symptoms manifest themselves in WordPress, and WordPress is storing the absolute URLs. There is probably a solution using WordPress. If I was to focus on the WordPress side of it only, then I suppose the question could be phrased as "How to detect URLs to images/files outside of the website?" – Highly Irregular Jun 9 '16 at 1:17
  • you could load a request logger extension in your browser and visit all the pages of the live site, then check the list for any dev.example.com occurrences (or whatever the dev domain is.) ...but then, why not just search the live database and all it's files for any reference of the dev domain? – majick Jun 9 '16 at 3:08
1

You could load a request logger extension in your browser and visit all the pages of the live site, then check the list for any dev.example.com occurrences (or whatever the dev domain is.) A Firefox extension for example HTTP Request Logger, but this might be better for double-checking checking specific page changes as it would be fairly time-consuming... But it would pick up for example relative paths in stylesheets that point to resources that do not exist on the live site.

Why not just search the live database and all it's files for any reference of the dev domain? There are database search plugins available to provide a UI for this you would probably just be able to write some simple directions for the other staff to use it.

For the files, it is less likely to be necessary as you would probably not hardcode dev domain URLS in your code but it may be worth a checking (using grep via SSH for example) if it is a major dev update or taking over from another developer.

Another idea... make a copy of the live site locally instead of the dev site and somehow block access to the dev domain temporarily from your local access, ie. client-side not server-side. Then browse your local copy, you would soon see any resource problems in your console window.

1

The only possible answer is to code review your code, maybe start with searching for explicit "http:" strings. Under wordpress coding best practices there should not be any and if you find any, even if they don't break anything right now, fix them as well.

  • In my case, the site has been created by graphic designers who know a bit of CSS but otherwise don't write code. It's really just the content I'm worried about. Thanks for your answer though; it's still likely to be useful to others. – Highly Irregular Jun 9 '16 at 9:54
  • 1
    if it is content, just search for it with the search forms admin side. if you know what to look domain to look for it should not be too hard – Mark Kaplun Jun 9 '16 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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