Access denied You must log in before you can access this resource!

On a website that is under construction, we get the following message:

Access denied You must log in before you can access this resource!”

When you open the website, it takes you to the following link:

/index.php?dispatch=auth.login_form&return_url=index.php

If you click the logo to go back to the homepage, you get the same url.

What did we do wrong in a setting?
Anyone?

From Google Gemini:

A new CS-Cart installation forcing redirects to a login page usually means an add-on (like a specific “Login Redirect” module) is enabled, your storefront’s settings are configured for restricted access (maybe country-based), a cache issue from a migration, or a misconfigured SSL/HTTP redirect loop, preventing anonymous users from seeing content unless logged in. Check for installed add-ons first, then look at regional settings and server configurations for common culprits.

Common Causes & Solutions:

  1. Login Redirect Add-on: A specific add-on might be forcing all non-logged-in users to the sign-in page.
  • Solution: Check your installed add-ons in the admin panel and disable any “Login Redirect” or similar modules.
  1. Regional/Storefront Redirects: You might have multiple storefronts set up for different regions, and your IP is being mapped to a restricted one.
  1. Cache Problems: A leftover cache from a development or staging site can cause strange redirects.
  1. Server-Level Redirect Loops (HTTP/HTTPS): An infinite loop between your server’s SSL settings and CS-Cart’s own SSL handling can redirect endlessly.
  • Solution: Check your config.php file and server settings for conflicting HTTP to HTTPS redirects.
  1. Specific Page Issues (404s): An add-on might redirect 404 errors to a login page instead of the homepage.
  • Solution: Look for custom redirect settings within SEO or 404 handling add-ons.

Start by checking for newly installed or enabled add-ons, as they are the most frequent cause for this behavior in new setups.

Please check if the Access for authorized customers only option is enabled in the settings of your storefront, at the Settings > Storefronts page of the admin panel.

Yes, this is the correct answer. Thanks.
Someone changed this without checking the website after this…

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.