This is Opencart 2.2.0.0, clean version, just installed paypal express checkout module in payment section.
I'm trying to test the payment and add one product to cart, there is a pop up message shows:
This site says
Error
Underfined
Anybody has this issue and know what's the problem? Thank you!
Attachments
opencart 2.2 error.jpg (6.48 KiB) Viewed 7880 times
According to stack overflow, this is the preferred way:
Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
It's very clear for step1-6, I'll do that.
May I confirm the last step? just want to make sure I will do the right way.
1. find the .htaccess.txt in the public_html folder;
2. edit it by adding the coding your provided to line 31?
3. save it and rename the .htaccess.txt to .htaccess
see attached photos. Am I right?
Attachments
1.jpg (79.11 KiB) Viewed 7862 times
2.jpg (85.57 KiB) Viewed 7862 times
3jpg.jpg (40.77 KiB) Viewed 7862 times
I've completed those steps and it work, non-www redirected to www site. May I ask one more favor? how to have it redirected to https instead of http so that I can have padlock icon for every pages? right now every page is http not https.
(1) system/config/catalog.php had been edited per your instruction.
Do I need to edit the system/config/admin.php as well?
attached is the admin.php (just look like to same as catalog.php before editing.
Attachments
5-3-16--0.jpg (9.84 KiB) Viewed 7823 times
(1) modified .htacess file
(2) public_html/config.php
(3) public_html/admin/config.php
what coding should I add to have SSL padlock show to every pages, or at least homepage, checkout, payment pages?
PS: I've installed SSL certificate in the server.
Thank you very much
Attachments
5-3-16.jpg (59.85 KiB) Viewed 7823 times
5-3-16-2.jpg (12.39 KiB) Viewed 7823 times
5-3-16-3.jpg (21.56 KiB) Viewed 7823 times
This is just for other people who has the same issues. see markup as attached.
I edited the config.php in both root and admin folder. and it works, now, every pages goes to https:// and have padlock icon beside it.
Attachments
5-3-16-5.jpg (48.92 KiB) Viewed 7813 times
In the store admin is defined to SSL true.
Bellow my htaccess in root and in folder store:
/.htaccess
Code: Select all
# Acesso http redirecionado para https
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www.(.*) [NC]
RewriteRule (.*) https://mydomain.com.br%{REQUEST_URI} [L,QSA]
RewriteCond %{HTTP_HOST} ^mydomain.com.br$ [NC,OR]
RewriteCond %{REQUEST_URI} !store/
RewriteCond %{REQUEST_URI} !loja/
RewriteRule (.*) /store/$1 [L]
Code: Select all
RewriteBase /store/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) 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} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]
Reason: Added code tags.
I have the same issue in opencast 2.2.0.0 , a user reported the "undefined error" when adding an item to the shopping cart. Prior to this my test had not shown this error.
reading the solution I have experimented further
the domain is used without www and then it works fine
if I use http://www.domain_name the error occurs.
When I add the lines as described above (very well described I like to add) this creates many problems the home page is completely garbled up.
there was initially no .htaccess file in my public_html folder
this is the beginning of config.php in the root
<?php
Code: Select all
// HTTP
define('HTTP_SERVER', 'http://funwithfido.co.uk/');
// HTTPS
define('HTTPS_SERVER', 'http://funwithfido.co.uk/');
// DIR
Code: Select all
<?php
// HTTP
define('HTTP_SERVER', 'http://funwithfido.co.uk/admin/');
define('HTTP_CATALOG', 'http://funwithfido.co.uk/');
// HTTPS
define('HTTPS_SERVER', 'http://funwithfido.co.uk/admin/');
define('HTTPS_CATALOG', 'http://funwithfido.co.uk/');
Daniel
Reason: Added code tags.
http and www is redirected straight to https://domain
You could customize to your needs
Code: Select all
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Example:
---
http:// www. shopsite/shop_index.php (default Site Access)
---
Now, if an image/Script Subdomain Link would look like:
---
http:// shopsite/image/...
http:// scripts. shopsite/...
http:// images. shopsite/image/...
http:// scripts. shopsite/scripts/...
---
e.t.c., the images and Scripts would all be redirected as well by the .htaccess order, and called from:
---
http:// www. shopsite/...
http:// www. shopsite/image/...
http:// www. shopsite/scripts/...
---
e.t.c., because the .htaccess is ordered to do this, and therefore not longer be Cookie-free as well !
A Double Shot in the knee, kind of...

At least, if a SHOP is placed in the Site ROOT Section, and, therefore, only ONE .htaccess File exists,
for the Site and the Shop. But if a Shop is placed in a Subdirectory, above mentioned Findings
have NO effect, if the Site /ROOT/ .htaccess - WWW or no WWW - Site Rerouting is defined in the ROOT
Directory, and the ../Shop/ .htaccess File does NOT contain such specific rerouting Informations.
According to what I just found out, after placing my first test Shop in the Site ROOT Section.

Ernie
This .htaccess File is, what I usually have in my HTML ROOT Section, to redirect everything
to WWW: where I have my master index.html HTML Page, serving as IFRAME-Masterpage,
to have the Responsive Demo Framepages working. It can be set either way, by QUOTING, what is not used.
Code: Select all
# Rabbit Rabbit Security Upgrade
Options +SymLinksIfOwnerMatch
# Prevent Directory listing
Options -Indexes
# SEO URL Settings
RewriteEngine On
RewriteBase /
#Force (http host) www to non www (optional)
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#Force (https host) www to non www (optional)
#RewriteCond %{HTTPS} on
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
#Force (http host) non www to www (optional)
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
#Force (https host) non www to www (optional)
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
#@__HCP_END__@#
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
my site is non-www and HTTPS is not working. I have tried all of the steps above (changing config/ admin config, setting to true etc) and continually get the too many reroutes 500 error.IP_CAM wrote:and just to mention it, this .htaccess routing only functions, without producing 'too many rerouting' messages on Test Sites, if NO Image/Script Subdomain Routing has been defined, linked to the Shop Site.
Example:
---
http:// www. shopsite/shop_index.php (default Site Access)
---
Now, if an image/Script Subdomain Link would look like:
---
http:// shopsite/image/...
http:// scripts. shopsite/...
http:// images. shopsite/image/...
http:// scripts. shopsite/scripts/...
---
e.t.c., the images and Scripts would all be redirected as well by the .htaccess order, and called from:
---
http:// www. shopsite/...
http:// www. shopsite/image/...
http:// www. shopsite/scripts/...
---
e.t.c., because the .htaccess is ordered to do this, and therefore not longer be Cookie-free as well !
A Double Shot in the knee, kind of...![]()
At least, if a SHOP is placed in the Site ROOT Section, and, therefore, only ONE .htaccess File exists,
for the Site and the Shop. But if a Shop is placed in a Subdirectory, above mentioned Findings
have NO effect, if the Site /ROOT/ .htaccess - WWW or no WWW - Site Rerouting is defined in the ROOT
Directory, and the ../Shop/ .htaccess File does NOT contain such specific rerouting Informations.
According to what I just found out, after placing my first test Shop in the Site ROOT Section.![]()
Ernie
This .htaccess File is, what I usually have in my HTML ROOT Section, to redirect everything
to WWW: where I have my master index.html HTML Page, serving as IFRAME-Masterpage,
to have the Responsive Demo Framepages working. It can be set either way, by QUOTING, what is not used.
Code: Select all
# Rabbit Rabbit Security Upgrade Options +SymLinksIfOwnerMatch # Prevent Directory listing Options -Indexes # SEO URL Settings RewriteEngine On RewriteBase / #Force (http host) www to non www (optional) #RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] #RewriteRule ^(.*)$ http://%1/$1 [R=301,L] #Force (https host) www to non www (optional) #RewriteCond %{HTTPS} on #RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] #RewriteRule ^(.*)$ https://%1/$1 [R=301,L] #Force (http host) non www to www (optional) RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] #Force (https host) non www to www (optional) RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] #@__HCP_END__@#
My site is in the route folder.
do I need to include the # from the above codes in the files?
Just to add I have added this code
Code: Select all
#Force (https host) www to non www (optional)
#RewriteCond %{HTTPS} on
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
only the home page and checkout remain in HTTPS the otherpages all still revert to HTTP. Oh it remains as www. too so not redirecting to non-www
One can SWITCH OFF such lines, i.E., in order to leave a Routine in both ways, but only
use one of them, matching individual requirements. Like in this specific Sections,
where one has to either change to www. or no www.
Ernie
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Thanks ErnieIP_CAM wrote:# means, that this Line has just an informative Value, it's DISABLED from doing anything!
One can SWITCH OFF such lines, i.E., in order to leave a Routine in both ways, but only
use one of them, matching individual requirements. Like in this specific Sections,
where one has to either change to www. or no www.
Ernie

Users browsing this forum: No registered users and 16 guests