• Resolved Magic-Pixels

    (@magic-pixels)


    Hi guys,

    I have been having a problem migrating a site for a client. I managed to get the site across, then ran a search / replace on the database to update all the URL, everything worked, the site was displaying all images perfectly.

    I then discovered that the server was using a separate FTP account, so I gave it full access (777) to the /wp-content folder and sub directories. Since then the links to all the images on the site have doubled up. For example the thumbnails on the photogallery all have links like :

    http://www.chigwelltours.co.uk/http://www.chigwelltours.co.uk/wp-content/uploads/2015/02/IMG_6424-300×200.jpg”

    When the file location is :-
    http://www.chigwelltours.co.uk/wp-content/uploads/2015/02/IMG_6424-300×200.jpg”

    I have tried running a search / replace on the DB, but it didn’t find any records to update. My question is this :- As I would rather not have to re-upload every image on the site, does anyone know of a quick way to wrestle all these links back into their proper form?

    Just in case it matters here are some details of the install

    the server is running linux,
    the theme is called minimum,

    the following plugins are being used :-
    Woocommerce
    Woocommerce bookings
    Gravity forms
    Revolution Slider
    EP Social Widget

    Thanks in advance, this one has me stumped!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    It sounds like maybe the search/replace didn’t work quite right?

    I’d recommend searching for all instances of:

    http://www.chigwelltours.co.uk/http://www.chigwelltours.co.uk/

    and replacing with:

    http://www.chigwelltours.co.uk/

    If your server has WP-CLI installed, use: http://wp-cli.org/commands/search-replace/

    Otherwise, use this plugin: https://wordpress.org/plugins/better-search-replace/

    Thread Starter Magic-Pixels

    (@magic-pixels)

    Fixed it, I had to drop the database, and re-import it.

    Thread Starter Magic-Pixels

    (@magic-pixels)

    Ah, thanks for the response.

    Apparently since wordpress 4.1 image urls are no longer stored in the database, (said some posts I read, I don’t know where they are stored now) which is why the the search and replace didnt work.

    Anyway, I dropped the database, then imported it again from the old server, ran the search and replace for the permalinks and now everything seems to work.

    Weird, but working.. thats good enough for me 😀

    Thread Starter Magic-Pixels

    (@magic-pixels)

    Actually, it seems I spoke too soon. The links have all changed themselves again. This is a really weird issue.

    I have tried the search you suggested, but it didn’t come back with any results….

    Thread Starter Magic-Pixels

    (@magic-pixels)

    Ah, as with all weird issues it seems, the cause was me doing something stupid! I made the mistake of defining the uploads folder in the Settings – Media as an absolute path, rather than a relative one, which resulted in wordpress bolting on the extra url on the fly.

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Excellent, thanks for sharing your solution!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Media file URL issues’ is closed to new replies.