Post by ceapaverde » Fri Mar 06, 2020 10:16 pm

Hello
I have a problem with Opencart 3.0.2.0.
www.cosseboutique.ro is my website, and while in Haine category whenever I try to either exapand the page to show more than 9 items per page, or try to go to second page it starts loading and it never gets there. The ajax loading gif starts and it just keeps going, never actually getting to what I need.
I have attached a screenshot so you can see better what I am talking about.

I would very much appreciate if someone can help me.

Thank you very much!

Attachments

Capture.PNG

Capture.PNG (462.45 KiB) Viewed 649 times


Newbie

Posts

Joined
Fri Mar 06, 2020 10:00 pm

Post by Quino » Fri Mar 06, 2020 10:26 pm

CORS issue, do not mix www and non-www domains.

New member

Posts

Joined
Fri Feb 28, 2020 1:19 am

Post by ceapaverde » Fri Mar 06, 2020 11:50 pm

Could you explain more please, because I dont really know what that means? ;D

Newbie

Posts

Joined
Fri Mar 06, 2020 10:00 pm

Post by Quino » Sat Mar 07, 2020 12:00 am

your site is using https://www.cosseboutique.ro but the ajax call for getting the next page is using https://cosseboutique.ro and that is cross-origin/domain.
So check your config files and/or htaccess to make sure you use either www or no www for all links.
I suspect it is the htaccess because if I go to www.cosseboutique.ro in http, it adds another www to the url to get to https.

it is probably both as you can see in your page source, links with https://www...... and https://.....

New member

Posts

Joined
Fri Feb 28, 2020 1:19 am

Post by ceapaverde » Sun Mar 08, 2020 2:10 am

Thank you very much!

Newbie

Posts

Joined
Fri Mar 06, 2020 10:00 pm

Post by ceapaverde » Sun Mar 08, 2020 3:37 am

I tried to fix it, but I dont really get it ;D
Here is my code from .htacces, if you want to take a look at it:

Code: Select all

SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(.*)$  [NC]
RewriteRule (.*) https://www.%1/$1 [R=301,L]

Header unset ETag
FileETag None

<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$">
	Header unset Last-Modified
	Header set Expires "Fri, 21 Dec 2100 00:00:00 GMT"
	Header set Cache-Control "public, no-transform"
</FilesMatch>

<IfModule mod_expires.c>
  ExpiresActive on
 
# Perhaps better to whitelist expires rules? Perhaps.
  ExpiresDefault                          "access plus 1 month"
 
# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
  ExpiresByType text/cache-manifest       "access plus 0 seconds"

# Your document html
  ExpiresByType text/html                 "access plus 0 seconds"
   
# Data
  ExpiresByType text/xml                  "access plus 0 seconds"
  ExpiresByType application/xml           "access plus 0 seconds"
  ExpiresByType application/json          "access plus 0 seconds"
 
# RSS feed
  ExpiresByType application/rss+xml       "access plus 1 hour"
 
# Favicon (cannot be renamed)
  ExpiresByType image/x-icon              "access plus 1 week"
 
# Media: images, video, audio
  ExpiresByType image/gif                 "access plus 1 month"
  ExpiresByType image/png                 "access plus 1 month"
  ExpiresByType image/jpg                 "access plus 1 month"
  ExpiresByType image/jpeg                "access plus 1 month"
  ExpiresByType video/ogg                 "access plus 1 month"
  ExpiresByType audio/ogg                 "access plus 1 month"
  ExpiresByType video/mp4                 "access plus 1 month"
  ExpiresByType video/webm                "access plus 1 month"
   
# HTC files  (css3pie)
  ExpiresByType text/x-component          "access plus 1 month"
   
# Webfonts
  ExpiresByType font/truetype             "access plus 1 month"
  ExpiresByType font/opentype             "access plus 1 month"
  ExpiresByType application/x-font-woff   "access plus 1 month"
  ExpiresByType image/svg+xml             "access plus 1 month"
  ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
     
# CSS and JavaScript
  ExpiresByType text/css                  "access plus 1 year"
  ExpiresByType application/javascript    "access plus 1 year"
  ExpiresByType text/javascript           "access plus 1 year"
   
  <IfModule mod_headers.c>
    Header append Cache-Control "public"
  </IfModule>
</IfModule>
# 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

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 /
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTPS_HOST}%{REQUEST_URI}[L,R=301]
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

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Last edited by straightlight on Sun Mar 08, 2020 4:54 am, edited 1 time in total.
Reason: Please add the code tags!

Newbie

Posts

Joined
Fri Mar 06, 2020 10:00 pm

Post by IP_CAM » Sun Mar 08, 2020 10:45 am

Add this: (into your .htaccess file)
to allow Scriptings, Styles, and Images to
be handled 'equal', regardless of, how they are 'called',
either by HTTPS: // SITE or then by HTTPS: // WWW. SITE

Code: Select all

## Allow cross-origin requests.
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|ico|pdf|flv|eot|woff|woff2|font.css|css|js)$">
Header set Access-Control-Allow-Origin "*"
Header always append X-Frame-Options SAMEORIGIN
</FilesMatch>
</IfModule>

## Send the CORS header for images when browsers request it.
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
</IfModule>
</IfModule>
before:

Code: Select all

## SEO URL Settings
RewriteEngine On
But find out also, why some of your REGULAR HREF linking is
HTTPS: //SITE and some is HTTPS: //WWW. SITE
'Reverse' Linking only works for IMAGES, x.CSS, and x.JS Files,
or it will screw up 'internal' href-commands, as in your case ...
Good Luck !
---
Image

Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Quino » Sun Mar 08, 2020 12:09 pm

Code: Select all

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(.*)$  [NC]
RewriteRule (.*) https://www.%1/$1 [R=301,L]
this is wrong, it will add www to www when requested over http.

for https enforcement just use:

Code: Select all

# force ssl except for binaries
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !.*\.(ico|cur|mp3|webp|ttf|eot|woff|woff2|gif|jpg|jpeg|png)$ [NC]
RewriteRule ^(.*)$ https://YOUR-DOMAIN/$1 [R=301,L,NE]
and add:

Code: Select all

header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
which will tell the browsers to always address your site using https so it will no longer need a server-side redirect.

for www enforcement use:

Code: Select all

# force www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://YOUR-DOMAIN/$1 [R=301,L,NE]

New member

Posts

Joined
Fri Feb 28, 2020 1:19 am
Who is online

Users browsing this forum: No registered users and 12 guests