• Resolved Insect Trojan

    (@insecttrojan)


    hello so i ned your help what i am doing wrong and i cant remove Query String even the setting is on.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support litetim

    (@litetim)

    @insecttrojan please provide us a Report Number. This can be generated in LSC => Toolbox => Reports => and click on “Send to Litespeed”.

    Thank you 🙂

    Thread Starter Insect Trojan

    (@insecttrojan)

    OK I did it the number is

    JBOTNCJG

    Plugin Support litetim

    (@litetim)

    Just to make sure I understood corectly: query string is not removed from .css and .js files, yes?

    • This reply was modified 1 year, 4 months ago by litetim.
    Thread Starter Insect Trojan

    (@insecttrojan)

    yes

    Plugin Support litetim

    (@litetim)

    I will look into it

    Plugin Support qtwrk

    (@qtwrk)

    you mean like this one ? /wp-content/litespeed/js/96145808334e4667de28e0b9e0c419c9.js?ver=091ba

    it’s deliberately added

    function remove_version_query( $content ) {

    return preg_replace('/(\.js|\.css)\?ver=' . LSCWP_V . '/', '$1', $content);
    }

    add_filter( 'litespeed_buffer_after', 'remove_version_query', 0);

    you can try this code snippet

    • This reply was modified 1 year, 4 months ago by qtwrk.
    Thread Starter Insect Trojan

    (@insecttrojan)

    yes the version I mean thanks for your help but i did it and it not removes the query string of version

    Plugin Support qtwrk

    (@qtwrk)

    oh , I see, my bad, copy paste the code snippet for other similar issue but not same as yours

    try this

    function remove_version_query($content) {
    return preg_replace('/(\.js|\.css)\?ver=[^&\'"]+/', '$1', $content);
    }

    add_filter('litespeed_buffer_after', 'remove_version_query', 0);
    Thread Starter Insect Trojan

    (@insecttrojan)

    it works now thanks a lot

    Plugin Support qtwrk

    (@qtwrk)

    this will probably remove all and any js/css in form of ?ver= , even not belong/generated by our plugin , so please check around a bit and make sure everything works

    or use

    return preg_replace('/(\/wp-content\/litespeed\/[^\/]+\/[^\/]+\.(js|css))\?ver=[^&\'"]+/', '$1', $content);

    to do narrower match for only /wp-content/litespeed/.......

    • This reply was modified 1 year, 4 months ago by qtwrk.
Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘remove Query String’ is closed to new replies.