Theme editor

Guide XenForo XenForo “Blocked due to another 4xx issue - misc/style-variation” Error Fix

  • Thread starter Thread starter CL4Y
  • Start date Start date
  • Views 138

CL4Y

Keyboard Ninja
Administrator
Thread owner
XenForo users sometimes encounter the following warning in Search Console related to the misc/style-variation path: Blocked due to another 4xx issue.
This error usually stems from a client-side response code such as 403 (Forbidden) or 404 (Not Found).

jetto-xenforo-search-consol-1.webp




✅ XenForo “Blocked due to another 4xx issue - misc/style-variation” Error Solution​

To resolve this issue, you’ll need to make a few adjustments in both the PAGE_CONTAINER template and your .htaccess file.
Once these steps are complete, the 4xx error will be eliminated.

Step 1: Add the Following Code to .htaccess​

Add the code below at the top of your .htaccess file.
This ensures that instead of a 4xx response, the server returns a 410 “Gone” status — indicating that the requested resource is permanently unavailable.

Code:
RewriteCond %{REQUEST_URI} ^/misc/style-variation$
RewriteCond %{QUERY_STRING} (reset=1|variation=(default|alternate))(&|$)
RewriteRule ^ - [G,L]

jetto-xenforo-search-consol-2.webp




Step 2: Edit the PAGE_CONTAINER Template​

Access your XenForo Admin Panel and navigate to:
Appearance → Templates → PAGE_CONTAINER.

Within that template, locate the following line:
Bash:
<xf:if is="$xf.visitor.canChangeStyleVariation($xf.style)">
Tip: You can use CTRL + F to search for it.

Once you find it, insert this line above it:
<xf:if is="{$xf.visitor.user_id}">
and close the condition afterward with:
</xf:if>

This will hide the style variation link from guests. As a result, Google bots will no longer attempt to access the misc/style-variation path, preventing the 4xx issue.
The first step also ensures that any previous 4xx logs are correctly handled as 410 (Gone).

Here’s how the updated code should look:
INI:
                                            <xf:if is="{$xf.visitor.user_id}">
                                            <xf:if is="$xf.visitor.canChangeStyleVariation($xf.style)">
                                                <a href="{{ link('misc/style-variation') }}" rel="nofollow"
                                                    class="js-styleVariationsLink"
                                                    data-xf-init="tooltip" title="{{ phrase('style_variation') }}"
                                                    data-xf-click="menu" data-z-index-ref=".u-bottomFixer" role="button" aria-expanded="false" aria-haspopup="true">

                                                    <xf:fa icon="{{ $xf.style.getVariationIcon($xf.visitor.style_variation) }}" title="{{ phrase('style_variation') }}" />
                                                </a>

                                                <div class="menu" data-menu="menu" aria-hidden="true">
                                                    <div class="menu-content js-styleVariationsMenu">
                                                        <xf:macro name="style_variation_macros::variation_menu"
                                                            arg-style="{$xf.style}"
                                                            arg-live="{{ true }}" />
                                                    </div>
                                                </div>
                                            </xf:if>
                                            </xf:if>

jetto-xenforo-search-consol-3.webp


✅ You can now request validation in Google Search Console. The verification process may take a few days to complete.
 
Thread owner
The process we performed is actually very simple: we resolved the errors we previously encountered on Search Console in step 1. We also addressed any new potential errors using the PAGE_CONTAINER template. This ensures visitors cannot alter the appearance of your theme. However, device-based day and night views will be automatically selected.

However, a logged-in user will be able to change the view from the footer section. This process is only for visitors and bots 🙂
 
Back
Top