1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Regex sql query for changing http links to https

Discussion in 'XenForo Questions and Support' started by dethfire, Jan 20, 2015.

  1. dethfire

    dethfire Well-Known Member

    I want to change my internal links from http to https. I have about 14 years of posts where members used my http. Can I do this with a sql query regex on my message field?
  2. AndyB

    AndyB Well-Known Member

    The query you want to run in phpMyAdmin is this:

    UPDATE xf_post SET message = REPLACE(message, 'http://www.physicsforums.com', 'https://www.physicsforums.com')
    Please run this type of query only after a recent backup.
    Amin Sabet and Mouth like this.
  3. DeltaHF

    DeltaHF Well-Known Member

    Note: if you have enabled the Cache BB Code Output setting in the AdminCP > Options > Performance page, then all of your posts will be cached in the xf_bb_code_parse_cache table, so you won't see the changes applied immediately after running Andy's query above.

    To refresh the cache, simply run the following query when you are done:
    TRUNCATE TABLE xf_bb_code_parse_cache;
    Like dethfire, I also just moved from HTTP to HTTPS and updated all the internal links in my forum. I couldn't see the changes, but this was why. Hope it helps someone else. :)
    Amin Sabet and dethfire like this.

Share This Page