Post by Marzy1357 » Tue Jul 31, 2018 6:19 am

Hi, I installed newest version of OC and Alvina theme from theme forest. When I change htaccess.txt to .htaccess my website becomes not accessible and gives Internal server error. if I change it to .htaccess. website starts working but SEO links not, if I press refresh in filezilla, .htaccess. file changes itself to "_B0JMG~J"

Other problem I have is with www and non-www version, I installed my website as https://www. and if I access it from non www there are icons missing, wrong font etc, I tried to use this method

Code: Select all

RewriteCond %{HTTPS} on

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]

RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
But it still doesnt work

Newbie

Posts

Joined
Sat Jan 16, 2016 6:09 pm

Post by sanshay » Tue Jul 31, 2018 4:51 pm

Check and Try this ones

First see in ftp that your theme in catalog has been chmod to 755 or most cases 777.
Also image folder has been set to 777

In config.php set all http to https. Just change domain.com to your domain

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'https://domain.com/');
// HTTPS
define('HTTPS_SERVER', 'https://domain.com/');
In admin/config.php

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'https://domain.com/admin/');
define('HTTP_CATALOG', 'https://domain.com/');
// HTTPS
define('HTTPS_SERVER', 'https://domain.com/admin/');
define('HTTPS_CATALOG', 'https://domain.com/');
In admin/system/settings and tab server, see that "use seo urls" is set to yes also Use SSL to yes.

htaccess settings:

Code: Select all

# 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/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 have set from www to non www
Just change te domain and .com to your domain

Code: Select all

RewriteCond %{HTTP_HOST} ^www\.domain\.com[NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
Always Redirect to HTTPS
In this case if you use custom html code i dont add https anymore but double slash, example:
//domain.com/images/xxxxx

Code: Select all

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
So i should looks like this:

Code: Select all

# 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/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 %{HTTP_HOST} ^www\.domain\.com[NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Regards

Active Member

Posts

Joined
Fri Jan 25, 2013 8:49 pm

Post by paulfeakins » Tue Jul 31, 2018 6:09 pm

Submit a ticket to your webhost.

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


User avatar
Guru Member

Posts

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

Post by ahimanshu » Wed Sep 23, 2020 1:06 pm

Please read this article, might be helpful for you viewtopic.php?t=7740

Regards
Himanshu


User avatar
New member

Posts

Joined
Mon Jul 10, 2017 10:55 am
Location - New Delhi

Post by letxobnav » Wed Sep 23, 2020 1:51 pm

So i should looks like this:
# 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/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 %{HTTP_HOST} ^www\.domain\.com[NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
all www <> non-www and http > https redirect rules should be put first.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: Axlagusti, niagato and 485 guests