Page 1 of 1

ssl and seo url question

Posted: Fri May 01, 2015 7:16 pm
by ljlau
opencart 2.0.2.0,apache2 installed ssl correctly,when I choose "use ssl Yes" and "use SEO urls Yes",index page was normally,but categories and products were all 404,no pages there.if choosed "use SEO urls No",products and catagories were all display correctly.

anyone can help?

Re: ssl and seo url question

Posted: Fri May 01, 2015 9:05 pm
by yodapt
Have you edited the .htaccess file?

Re: ssl and seo url question

Posted: Fri May 01, 2015 9:40 pm
by ljlau
yodapt wrote:Have you edited the .htaccess file?
no I didn't.
how to edit .htaccess file? thx.

Re: ssl and seo url question

Posted: Fri May 01, 2015 10:54 pm
by yodapt
Most of the time you dont need to edit the file, but you must ensure Apache is able to use the RewriteEngine, and in case you have your shop within domain folder(s), you must specify it on that file, changing the following line :

Code: Select all

RewriteBase /folder_path/


It is also possible, but unlikely, that the default .htaccess doesn't work properly in your Apache version, but there is no telling without troubleshooting your situation.

Try to disable SSL and see if the SEO URL works without it first.

Re: ssl and seo url question

Posted: Sat May 02, 2015 12:48 pm
by ljlau
yodapt wrote:Most of the time you dont need to edit the file, but you must ensure Apache is able to use the RewriteEngine, and in case you have your shop within domain folder(s), you must specify it on that file, changing the following line :

Code: Select all

RewriteBase /folder_path/


It is also possible, but unlikely, that the default .htaccess doesn't work properly in your Apache version, but there is no telling without troubleshooting your situation.

Try to disable SSL and see if the SEO URL works without it first.
I had did it.

I mean that when I disable SSL,products and categories are all correctly by using SEO URLs,when I use SSL and SEO urls,it doen't correcty.

thank you for your reply and sorry for my pool English.

Re: ssl and seo url question

Posted: Sat May 02, 2015 1:11 pm
by bhraqnet
Enabling SSL in the OpenCart directory config.php file

Log into cPanel and go to File Manager
Navigate to your OpenCart installation directory
Open (Edit or Code Editor) the configuration file (config.php)
Look for the lines below // HTTPS that looks similar to this:

Code: Select all

define('HTTPS_SERVER', 'http://opencart.inmotiontesting.com/');
define('HTTPS_IMAGE', 'http://opencart.inmotiontesting.com/image/');
Edit the HTTPS settings to reflect your SSL URL path. For example:

Code: Select all

 define('HTTPS_SERVER', 'https://opencart.inmotiontesting.com/');
define('HTTPS_IMAGE', 'https://opencart.inmotiontesting.com/image/');

Save changes and close the config.php file

Enabling SSL in the OpenCart Admin folder config.php file

Go to the “Admin” folder
Open (Edit or Code Editor) the configuration file (config.php)
Look for the lines below // HTTPS that looks similar to this:

Code: Select all

define('HTTPS_SERVER', 'http://opencart.inmotiontesting.com/admin/');
define('HTTPS_CATALOG', 'http://opencart.inmotiontesting.com/');
define('HTTPS_IMAGE', 'http://opencart.inmotiontesting.com/image/');
Edit the HTTPS settings to reflect your SSL URL path. For example:

Code: Select all

define('HTTPS_SERVER', 'https://opencart.inmotiontesting.com/admin/');
define('HTTPS_CATALOG', 'https://opencart.inmotiontesting.com/');
define('HTTPS_IMAGE', 'https://opencart.inmotiontesting.com/image/');
Save changes and close the config.php file

Re: ssl and seo url question

Posted: Sat May 02, 2015 6:52 pm
by ljlau
bhraqnet wrote:Enabling SSL in the OpenCart directory config.php file

Log into cPanel and go to File Manager
Navigate to your OpenCart installation directory
Open (Edit or Code Editor) the configuration file (config.php)
Look for the lines below // HTTPS that looks similar to this:

Code: Select all

define('HTTPS_SERVER', 'http://opencart.inmotiontesting.com/');
define('HTTPS_IMAGE', 'http://opencart.inmotiontesting.com/image/');
Edit the HTTPS settings to reflect your SSL URL path. For example:

Code: Select all

 define('HTTPS_SERVER', 'https://opencart.inmotiontesting.com/');
define('HTTPS_IMAGE', 'https://opencart.inmotiontesting.com/image/');

Save changes and close the config.php file

Enabling SSL in the OpenCart Admin folder config.php file

Go to the “Admin” folder
Open (Edit or Code Editor) the configuration file (config.php)
Look for the lines below // HTTPS that looks similar to this:

Code: Select all

define('HTTPS_SERVER', 'http://opencart.inmotiontesting.com/admin/');
define('HTTPS_CATALOG', 'http://opencart.inmotiontesting.com/');
define('HTTPS_IMAGE', 'http://opencart.inmotiontesting.com/image/');
Edit the HTTPS settings to reflect your SSL URL path. For example:

Code: Select all

define('HTTPS_SERVER', 'https://opencart.inmotiontesting.com/admin/');
define('HTTPS_CATALOG', 'https://opencart.inmotiontesting.com/');
define('HTTPS_IMAGE', 'https://opencart.inmotiontesting.com/image/');
Save changes and close the config.php file
I had already did this,but the categories and products still 404.

Re: ssl and seo url question

Posted: Sat May 02, 2015 11:43 pm
by bhraqnet
It has experience
There is a programmatic error
open catd 2.0.2.0

Re: ssl and seo url question

Posted: Sun May 03, 2015 8:04 pm
by bhraqnet
http://forum.opencart.com/viewtopic.php ... 06#p558706

Seems to be working, last question, do I not need rewritebase /

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^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]

Re: ssl and seo url question

Posted: Thu May 07, 2015 6:48 pm
by ljlau
bhraqnet wrote:http://forum.opencart.com/viewtopic.php ... 06#p558706

Seems to be working, last question, do I not need rewritebase /

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^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]
I had tried this,but still 404...

thx

Re: ssl and seo url question

Posted: Fri May 08, 2015 12:58 am
by qahar
ljlau wrote:opencart 2.0.2.0,apache2 installed ssl correctly,when I choose "use ssl Yes" and "use SEO urls Yes",index page was normally,but categories and products were all 404,no pages there.if choosed "use SEO urls No",products and catagories were all display correctly.

anyone can help?
First make sure it's .htaccess and not htaccess.txt
When SEO enabled, try to access product both with their url alias and full route url
What happen when you access information page by their url alias? you see the page or get 404?

If you use extensions with ocmod or vqmod try to disable them all.
It's to ensure extension you use is not causing this. Specialy if you use seo extension that might be misconfigured properly

Re: ssl and seo url question

Posted: Fri Jun 24, 2016 12:58 am
by integris
I ended up on this thread trying to find answers for getting an OC2.2 shop to work with SSL/https/www. I compiled a list of steps I had to take to get it working here: http://stackoverflow.com/questions/3627 ... t/37996993