302 redirect error in google

Discussion in 'Installation/Configuration' started by HenrysCat, Apr 2, 2021.

  1. HenrysCat

    HenrysCat Member

    I have a problem with one website in that google adsense is rejecting a url (mydomain.com/public) for ads due to "Crawler redirected too many times"
    When running the url through Screaming Frog it gives this,

    Status Code 302
    Status Found
    Indexability Non-Indexable
    Indexability Status Redirected
    Redirect Type HTTP Redirect

    Any ideas?
    Thanks all
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    It means your page is redirecting, Google wants the page where users end up.
     
  3. HenrysCat

    HenrysCat Member

    The page in the browser is https://mydomain.com/public nothing else there, it worked fine on VestaCP but now I moved site to ISPConfig I get 302 error
     
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Could you share the real domain?
     
  5. HenrysCat

    HenrysCat Member

  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

  7. HenrysCat

    HenrysCat Member

    OK, where would I start? sorry if it's a dumb question :)
     
  8. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Check if there is a .htaccess in place with redirect rules to start.
     
  9. HenrysCat

    HenrysCat Member

    There is but they are default from the script dev.
     
  10. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Could you share the content?
     
  11. HenrysCat

    HenrysCat Member

    This is from root folder

    Code:
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{REQUEST_URI} !^public
        RewriteRule ^(.*)$ public/$1 [L]
    </IfModule>
    This from /public
    Code:
    <IfModule mod_rewrite.c>
        <IfModule mod_negotiation.c>
            Options -MultiViews -Indexes
        </IfModule>
    
        RewriteEngine On
    
        # Handle Authorization Header
        RewriteCond %{HTTP:Authorization} .
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        # Redirect Trailing Slashes If Not A Folder...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]
    
        # Send Requests To Front Controller...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
    </IfModule>
     
  12. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Examine problem with redirect checker (find them with Internet Search Engines). For example https://www.redirect-checker.org/ Perhaps those provide some insight where the redirect loop comes from.
    Quick check shows https://rainmail.xyz/ works but adding mailbox shows redirect loop. So my guess is the mailbox is redirects to itself.
     
    Last edited: Apr 3, 2021
    HenrysCat likes this.
  13. HenrysCat

    HenrysCat Member

    Finally managed to convince the dev to look closer and it was this line in the php code
    return redirect()->route(‘app’);
    Removed and working, so not ISPC related at all, thanks for the tips though, definitly helped ;)
     
    till likes this.

Share This Page