Skip to main content
Known Participant
February 2, 2018
Answered

Adding http:// to existing url's

  • February 2, 2018
  • 2 replies
  • 349 views

I've been running my site successfully for years, coded with Dreamweaver CS3.

In the last few weeks my Adsense ads (size 160 x 600) have sometimes been replaced with a panel (of the same size) from my server saying that 'the page (advert) cannot be found' (apparently error 404).

My 'Server's Help' say I should add http:// in front of all page URL's. First I'm wondering how I managed for all these years without it, but mainly how do I add the http:// on over 150 pages, and hopefully without having to edit each page individually.

    This topic has been closed for replies.
    Correct answer Jon Fritz

    In CC 2017 or later, hit Ctrl/Cmnd + Shift + F to open the Find & Replace tool.
    Click the Basic Tab
    In the first large field (unlabeled Find field), add the entire code of the link (<a href="//path-to/link.html">)

    For the "In" dropdown menu, choose Entire Current Local Site
    Leave the next field as [any tag]
    In the second large field (unlabeled Replace With field) add the entire code of the new link (<a href="http: //www.path-to/link.html">)
    Hit Replace All

    2 replies

    B i r n o u
    Legend
    February 2, 2018

    you can also use a reg exp in the search and replace files ({ctrl|cmd} shift f

    think to check the use of regular expression and search for

    href="(?!http*://)

    that you will replace with

    href="http://

    if you not used to regex... the search will focus on all string starting by href=" and not icnlude http with a facultative s and followed by ://

    that way you will only replace the url link that doesn't use any protocol

    be aware of depending on your web site, the reg ex can be adjusted

    Legend
    February 2, 2018

    But back up your site folder first incase anything hideously goes wrong.

    Jon Fritz
    Community Expert
    Jon FritzCommunity ExpertCorrect answer
    Community Expert
    February 2, 2018

    In CC 2017 or later, hit Ctrl/Cmnd + Shift + F to open the Find & Replace tool.
    Click the Basic Tab
    In the first large field (unlabeled Find field), add the entire code of the link (<a href="//path-to/link.html">)

    For the "In" dropdown menu, choose Entire Current Local Site
    Leave the next field as [any tag]
    In the second large field (unlabeled Replace With field) add the entire code of the new link (<a href="http: //www.path-to/link.html">)
    Hit Replace All