Varnish Error 503 VCL failed when url path ends with %
04:09 18 Dec 2025

My website gives a Error 503 VCL failed when url ends with %

I have tried to disable cache, and also tried redirect, in .htaccess but without success.

Here's my current .htaccess-configuration:


    RewriteEngine On

    # Redirect http to https
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}

    # Avoid existing
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d

    # Disable Varnish cache and redirect everything
    Header add "Cache-Control" "no-cache"
    RewriteRule ^(.*)$ index.php [R=301,L,QSA,B]


Any requests to index.php that ends with %, for example:

index.php?test=%

ends up with the Varnish Error 503 VCL failed error. I have tried multiple variations of the RewriteRule in the.htaccess-file, but none is working. I have tried with and without the cache, with and without:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

All other requests to index.php works just fine, like for example:

index.php?test=%C3

My goal here is not to actual handle the errornous %-requests, I just want to make sure such requests don't trigger the error. The error causes Google Search Console to refuse to index my website, because others (beyond my control) have posted such badly formated links to my website.

php apache .htaccess varnish