Strange cached url prefix with caching
A user on their local machine/intranet has a wildcard value setup to resolve to the servers IP address. Even though the DNS is configured to disregard any wildcard value, it seems as though a wildcard value is setup the point to the servers IP on a local/intranet machine.

What was happening was users mistyping the URL. With a typing of the URL "www", the page was still resolving and becoming cached in Craft.

From my local machine, I edited my host file to test this theory and it turned out to be the case.

Found that my rewrite conditions in the htaccess were messed. I've updated my htaccess rules as well (Arcustech server). Forces "WWW" over SSL.


RewriteEngine On

    # If SSL request WITHOUT WWW
    RewriteCond %{ENV:SECURE_REDIRECT} on
    RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
    RewriteCond %{HTTP_HOST} !^(local\..+|staging\..+|.+dev)$ [NC]
    RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # If NOT SSL request WITHOUT WWW
    RewriteCond %{ENV:SECURE_REDIRECT} !=on
    RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
    RewriteCond %{HTTP_HOST} !^(local\..+|staging\..+|.+dev)$ [NC]
    RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # If NOT SSL request WITH WWW
    RewriteCond %{ENV:SECURE_REDIRECT} !=on
    RewriteCond %{HTTP_HOST} ^www\..+$ [NC]
    RewriteCond %{HTTP_HOST} !^(local\..+|staging\..+|.+dev)$ [NC]
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]