Post by top10 » Fri Jul 09, 2021 12:46 am

hi opencart support team

so after moving to new server i had a few problems in cache but now everything is ok but i noticed that the language won't switch,
i have 3 languages in the site and i have 750 products translated to 3 languages
i can see that i have them on homepage but when i try to change the langauge it dosent work
and the admin keep logging out every time i refresh the homepage

my oc Version 3.0.3.7

the site is top-10.se

tried to modify the htaccess file but nothing help cleard the cache changed the storage path nothing seems to work

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



# Prevent Directoy listing


# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
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]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://%{HTTP_HOST}? [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.top-10\.se [NC]
RewriteRule (.*) http://top-10.se/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://top-10.se/$1 [R=301,L]
RewriteCond %{HTTP_HOST} top-10\.se [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.top-10.se/$1 [R,L]

Code: Select all

// DIR
define('DIR_APPLICATION', '/home/vol16_2/epizy.com/epiz_28995094/top-10.se/htdocs/catalog/');
define('DIR_SYSTEM', '/home/vol16_2/epizy.com/epiz_28995094/top-10.se/htdocs/system/');
define('DIR_IMAGE', '/home/vol16_2/epizy.com/epiz_28995094/top-10.se/htdocs/image/');
define('DIR_STORAGE', '/home/vol16_2/epizy.com/epiz_28995094/top-10.se/htdocs/storage/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/theme/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');

Newbie

Posts

Joined
Fri Jun 25, 2021 12:36 am

Post by straightlight » Fri Jul 09, 2021 1:40 am

While both config.php files (without DB info) haven't been posted, ensure that the storage folder is located outside of the public_html folder. See this topic, for instance: viewtopic.php?f=199&t=224484 . As for the language issues specifically, see if this solution can help you: viewtopic.php?t=166985#p641571

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 top10 » Fri Jul 09, 2021 2:00 am

straightlight wrote:
Fri Jul 09, 2021 1:40 am
While both config.php files (without DB info) haven't been posted, ensure that the storage folder is located outside of the public_html folder. See this topic, for instance: viewtopic.php?f=199&t=224484 . As for the language issues specifically, see if this solution can help you: viewtopic.php?t=166985#p641571
thanks for the reply
the language issues is not with the files i think, because when i open the site from my phone it shows Arabic language, but when i open the site from the pc it show the site with swedish language, it might be the storage file located in public_html causing the language problems ...
regarding the DB info i can edit the config.php info i posted if needed

Newbie

Posts

Joined
Fri Jun 25, 2021 12:36 am

Post by straightlight » Fri Jul 09, 2021 2:04 am

top10 wrote:
Fri Jul 09, 2021 2:00 am
straightlight wrote:
Fri Jul 09, 2021 1:40 am
While both config.php files (without DB info) haven't been posted, ensure that the storage folder is located outside of the public_html folder. See this topic, for instance: viewtopic.php?f=199&t=224484 . As for the language issues specifically, see if this solution can help you: viewtopic.php?t=166985#p641571
thanks for the reply
the language issues is not with the files i think, because when i open the site from my phone it shows Arabic language, but when i open the site from the pc it show the site with swedish language, it might be the storage file located in public_html causing the language problems ...
regarding the DB info i can edit the config.php info i posted if needed
The proposed solution on the 2nd topic is not about the files, it is about the database. See if these two solutions does resolve the issue. Of course, you may want to consider a backup of your database and files prior to apply these modifications.

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 top10 » Fri Jul 09, 2021 3:12 am

straightlight wrote:
Fri Jul 09, 2021 2:04 am
top10 wrote:
Fri Jul 09, 2021 2:00 am
straightlight wrote:
Fri Jul 09, 2021 1:40 am
While both config.php files (without DB info) haven't been posted, ensure that the storage folder is located outside of the public_html folder. See this topic, for instance: viewtopic.php?f=199&t=224484 . As for the language issues specifically, see if this solution can help you: viewtopic.php?t=166985#p641571
thanks for the reply
the language issues is not with the files i think, because when i open the site from my phone it shows Arabic language, but when i open the site from the pc it show the site with swedish language, it might be the storage file located in public_html causing the language problems ...
regarding the DB info i can edit the config.php info i posted if needed
The proposed solution on the 2nd topic is not about the files, it is about the database. See if these two solutions does resolve the issue. Of course, you may want to consider a backup of your database and files prior to apply these modifications.
i tried to add both swedish and english in the "config_language" in the value section en-gb with the sv-se to see if its going to allow language switching from swedish to english with the help of phpmyadmin but it didnt help still not switching, otherwise the code and value in the config_language are all correct.

i think its problem with the server because when i use my local server it works fine i have no idea what to do :(

Newbie

Posts

Joined
Fri Jun 25, 2021 12:36 am

Post by ADD Creative » Fri Jul 09, 2021 5:48 am

Your links on the page are not https. Check all URLs are https in your config.php files. Your rewrite rules in your htaccess look wrong.

www.add-creative.co.uk


Expert Member

Posts

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

Post by top10 » Sat Jul 10, 2021 6:40 am

ADD Creative wrote:
Fri Jul 09, 2021 5:48 am
Your links on the page are not https. Check all URLs are https in your config.php files. Your rewrite rules in your htaccess look wrong.
hi
my config.php looks like this

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://top-10.se/');

// HTTPS
define('HTTPS_SERVER', 'https://top-10.se/');

// DIR
define('DIR_APPLICATION', '/home/vol16_2/epizy.com/epiz_28995094/top-10.se/htdocs/catalog/');
define('DIR_SYSTEM', '/home/vol16_2/epizy.com/epiz_28995094/top-10.se/htdocs/system/');
define('DIR_IMAGE', '/home/vol16_2/epizy.com/epiz_28995094/top-10.se/htdocs/image/');
define('DIR_STORAGE', '/home/vol16_2/epizy.com/epiz_28995094/top-10.se/htdocs/storage/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/theme/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'sql204.byetcluster.com');
define('DB_USERNAME', 'epiz_28995094');
define('DB_PASSWORD', 'WFnsPBjU13');
define('DB_DATABASE', 'epiz_28995094_top10');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_');
what is the right rules in my htaccess ? it redirect to the https

Newbie

Posts

Joined
Fri Jun 25, 2021 12:36 am

Post by ADD Creative » Sat Jul 10, 2021 7:27 am

top10 wrote:
Sat Jul 10, 2021 6:40 am
hi
my config.php looks like this

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://top-10.se/');

what is the right rules in my htaccess ? it redirect to the https
Should be.

Code: Select all

define('HTTP_SERVER', 'https://top-10.se/');
Remember to change the admin/config.php as well.

Code: Select all

RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://%{HTTP_HOST}? [R=301,L]
I assume this is trying to remove the "route=common/home". Don't do that in htaccess do it in catalog/controller/startup/seo_url.php. If you are going to do that in access, should rewrite to https.

Code: Select all

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.top-10\.se [NC]
RewriteRule (.*) http://top-10.se/$1 [R=301,L]
Again shouldn't redirect to http and the lines below are doing the same thing so would be pointless.

Code: Select all

RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://top-10.se/$1 [R=301,L]
This is OK.

Code: Select all

RewriteCond %{HTTP_HOST} top-10\.se [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.top-10.se/$1 [R,L]
All unsecured request should be redirected. Try.

Code: Select all

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
I hope that is not your actual config details.

www.add-creative.co.uk


Expert Member

Posts

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

Post by ADD Creative » Sat Jul 10, 2021 7:31 am

You also have a 301 Found redirect which is not in the htaccess. It could be added by an extension or maybe you hosting.

www.add-creative.co.uk


Expert Member

Posts

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

Post by top10 » Wed Jul 21, 2021 2:36 am

ADD Creative wrote:
Sat Jul 10, 2021 7:27 am
top10 wrote:
Sat Jul 10, 2021 6:40 am
hi
my config.php looks like this

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://top-10.se/');

what is the right rules in my htaccess ? it redirect to the https
Should be.

Code: Select all

define('HTTP_SERVER', 'https://top-10.se/');
Remember to change the admin/config.php as well.

Code: Select all

RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://%{HTTP_HOST}? [R=301,L]
I assume this is trying to remove the "route=common/home". Don't do that in htaccess do it in catalog/controller/startup/seo_url.php. If you are going to do that in access, should rewrite to https.

Code: Select all

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.top-10\.se [NC]
RewriteRule (.*) http://top-10.se/$1 [R=301,L]
Again shouldn't redirect to http and the lines below are doing the same thing so would be pointless.

Code: Select all

RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://top-10.se/$1 [R=301,L]
This is OK.

Code: Select all

RewriteCond %{HTTP_HOST} top-10\.se [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.top-10.se/$1 [R,L]
All unsecured request should be redirected. Try.

Code: Select all

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
I hope that is not your actual config details.
thanks for the reply i will try this out and let u know :)

Newbie

Posts

Joined
Fri Jun 25, 2021 12:36 am

Post by top10 » Wed Jul 21, 2021 2:56 am

ADD Creative wrote:
Sat Jul 10, 2021 7:31 am
You also have a 301 Found redirect which is not in the htaccess. It could be added by an extension or maybe you hosting.
sorry im newbie i have couple extensions installed but i dont get what do u mean with 301 is not in htaccess. ? i did as u said in the seo_url.php file
my htaccess. now looks like this

Code: Select all

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]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} top-10\.se [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.top-10.se/$1 [R,L]


Newbie

Posts

Joined
Fri Jun 25, 2021 12:36 am

Post by ADD Creative » Wed Jul 21, 2021 4:45 am

top10 wrote:
Wed Jul 21, 2021 2:56 am
sorry im newbie i have couple extensions installed but i dont get what do u mean with 301 is not in htaccess. ? i did as u said in the seo_url.php file
my htaccess. now looks like this

Code: Select all

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]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} top-10\.se [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.top-10.se/$1 [R,L]

Sorry I meant a 302 Found and might be in your htaccess. The following.

Code: Select all

RewriteCond %{HTTP_HOST} top-10\.se [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.top-10.se/$1 [R,L]
Should be.

Code: Select all

RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://top-10.se/$1 [R=301,L]

www.add-creative.co.uk


Expert Member

Posts

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

Users browsing this forum: lrjcarr@gmail.com and 116 guests