Post by soft2u » Thu Jun 10, 2021 6:20 am

I have been fighting with a issue the last past days, maybe causing our web shop not to show on Google.
I discovered that, when crawling the page, it gets constantly 302 redirects to itself.
Try http://redirectdetective.com/ OR https://www.redirect-checker.org/index.php
(Website is http://zamani.ae/)

The website is currently running OpenCart 3.0.3.3
This is my htaccess

Code: Select all

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
Options +FollowSymlinks

# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|.twig|\.ini|\.log|(?<!robots)\.txt))">
 Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200

# 7. disable open_basedir limitations
# php_admin_value open_basedir none
Please note that I added the following section in .htaccess to try to solve the problem, but it did not have any effect .

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
Do you have idea, what could cause this?

Newbie

Posts

Joined
Mon Jun 07, 2021 9:36 pm

Post by ADD Creative » Thu Jun 10, 2021 5:13 pm

Looks like it just correctly redirection http to https to me.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by soft2u » Thu Jun 10, 2021 9:59 pm

I was wish Google would have the same opinion as you :) , but unfortunately not . it is a 302 redirect
It means a temporary redirection and not once, but many times and definitely causes problems with search spiders .

Newbie

Posts

Joined
Mon Jun 07, 2021 9:36 pm

Post by ADD Creative » Fri Jun 11, 2021 12:34 am

Only saw one redirect, but it was as you say a 302. Check your hosting control panel, some have an option to redirect in there.

Could also be a bad modification like the one in the topic below.
viewtopic.php?f=202&t=224179

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Fri Jun 11, 2021 1:11 am

More specifically about this post: viewtopic.php?f=202&t=224179#p822553 .

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paulfeakins » Fri Jun 11, 2021 7:11 pm

soft2u wrote:
Thu Jun 10, 2021 9:59 pm
I was wish Google would have the same opinion as you :) , but unfortunately not . it is a 302 redirect
It means a temporary redirection and not once, but many times and definitely causes problems with search spiders .
If you can't figure this out, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by by mona » Fri Jun 11, 2021 7:13 pm

The 302 is not caused by your htaccess.
What I can see is that those "check sites" use http/1.0 so perhaps your host redirects those requests via their webserver config and does it in a bad way. So ask your host.

I doubt that search engines actually get that 302 redirect.

We normally block http/1.0 requests as they are mainly used by cheap proxies and covert bots anyway, no legitimate browser or public bot uses that.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: No registered users and 263 guests