Post by gcampher » Thu Nov 26, 2020 2:26 pm

All icons on my website are little squares
www.nutrimart.co.za
Please assist.

Newbie

Posts

Joined
Mon Oct 12, 2020 8:20 pm

Post by sw!tch » Thu Nov 26, 2020 4:33 pm

It's CORs, note the www prefix. Your shop URL is configured as https://example.com not https://www.example.com

Add a .htaccess redirect from www to the non-www variant.

Plenty of topics on this forum how to fix it.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Location - USA

Post by paulfeakins » Thu Nov 26, 2020 5:27 pm

gcampher wrote:
Thu Nov 26, 2020 2:26 pm
All icons on my website are little squares
www.nutrimart.co.za
Please assist.
This has been asked and answered a million times, please search before you post. Locking topic.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by mikeinterserv » Wed Dec 23, 2020 5:55 am

Care to give us a link
been hunting for a long time with no result.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by by mona » Wed Dec 23, 2020 6:05 am

:laugh: How did google manage to be successful ?

https://www.google.com/search?client=sa ... 8&oe=UTF-8

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Active Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by IP_CAM » Wed Dec 23, 2020 6:32 am


I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
4'400 + 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 mikeinterserv » Wed Dec 23, 2020 6:59 am

And there's me searching the OC forums
OK I got it - thanks for your help :-)
I wasn't being funny I genuinely tried various and numerous searches

Does this work for HTTPS or just HTTP

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by by mona » Wed Dec 23, 2020 7:18 am

mikeinterserv wrote:
Wed Dec 23, 2020 6:59 am
And there's me searching the OC forums
Presumably you mean the search engine on the forum?
In which case - DON’T - google spend millions to be the best search engine in the world - why use anything else?
Tip - just add the word opencart - or opencart forum - or opencart extensions ..

Lucky I can read between the lines here, but appreciate your efforts so I think this is what you are trying to ask for

Code: Select all

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*) yoursite.com%{REQUEST_URI} [R=301,L,NE]
RewriteBase /

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Active Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by IP_CAM » Wed Dec 23, 2020 7:41 am

Just test it, it should work with http:// and https://

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
4'400 + 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 mikeinterserv » Wed Dec 23, 2020 7:46 am

To be clearer my server already forces HTTPS so I don't specifically need to force ssl through htaccess
I didn't know whether http host and https host are 2 different things
I just want to force NON www - hope that makes it clearer anyway
much appreciate your replies

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by IP_CAM » Wed Dec 23, 2020 8:07 am

Then use one of the Fixes I linked above ...

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
4'400 + 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 mikeinterserv » Wed Dec 23, 2020 8:20 am

This worked perfect ONLY in the root directory
In my Shop folder I get this

https://mydomain.co.uk/mydomain.co.uk/Shop/

RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^mydomain\.co.uk$ [NC]
RewriteRule ^(.*)$ http://mydomain.co.uk/$1 [R=301,L]

If I have the htaccess in the root directory (htdocs) It appears to work ALL directories including the Shop folder inside htdocs.
So I am not familiar with htaccess and assumed it had to be in the shop folder. I still don't know if its working perfectly ok but it appears to be.
So does htaccess ONLY go in the root directory.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by IP_CAM » Wed Dec 23, 2020 9:00 am

Well, the SHOP .htaccess file needs to be located in the shop/ Directory
if one exists, otherwise, it's placed in the Shopsite ROOT. But you could
also place an .htaccess file in the ROOT directory, containing some
'global Values', if you know, what I mean with that ... :laugh:

In my Site ROOT, I have such an.htaccess file, it stops unwanted Visitor IP's
at the Door already, and a specific shop .htaccess, with all the Code, to so
hopefully keep that section as clean and secure as possible, including all
those present ~2'580 IP Ranges, mostly excluding the last .xxx Range in full.

Code: Select all

Deny from 1.32
Deny from 1.49.47
Deny from 207.46.13.184
Deny from 207.46.13.247
Deny from 207.108.46
Deny from 207.154.247
Deny from 223.73.2
Deny from 223.73.131
All those Ranges are already blocked in the ROOT and SHOP .htaccess File.
It might not be the 'ultimate' solution, when it comes to a high-traffic
Shop Site, but that's not a problem for me, since my Sites are only visited
by either OC Users or then Enemies, trying, to give me a hard time .... :laugh:
But it's basically a daily Job, to check on such, if one really cares about Security.

Ernie

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
4'400 + 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 mikeinterserv » Wed Dec 23, 2020 9:23 am

Thanks for you reply, I like to learn its much appreciated.
If I put ANY of the htaccess files in the Shop directory It redirects like this
https://mydomain.com/mydomain.com/Shop
It DOUBLES the domain name exactly like that
It does NOT do this from the root diretory

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by IP_CAM » Wed Dec 23, 2020 9:26 am

You can ONLY place the OC default .htaccess file into the Shop Directory,
it contains important Data, to make OC work as planned. One can add some
additional Code there too, but only, if one knows, what he's doing.

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
4'400 + 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 mikeinterserv » Wed Dec 23, 2020 10:14 am

The default htaccess file is completely blank in the shop directory.
I have not activated or currently used the htaccess.txt
So i filled out the empty htaccess file in the shop directory and the result of the redirect is always
https://mydomain.co.uk/mydomain.co.uk/Shop

My directory structure is like this
Root folder - htdocs
OC was installed into a folder inside the htdocs folder called Shop

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by IP_CAM » Wed Dec 23, 2020 6:03 pm

Check here, to learn about .htaccess files in General:
https://www.google.com/search?q=.htacce ... 8&oe=utf-8
---
This is a default OC .htaccess file, already set, to address an OC Install,
placed in an OC Shop/ Directory. ( written as Shop --- NOT shop)
Rename the line below, if your OC Install is placed in a shop/ Directory.
RewriteBase /Shop/ -- or -- RewriteBase /shop/

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
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 /Shop/
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
and if you have an empty .htaccess file somewhere, named either
.htaccess or .htaccess.txt, delete it.

And don't forget, Server ROOT or Site ROOT is not the same, the
SITE ROOT is the Base Section in your Online Site.

Good Luck! ;)
Ernie

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
4'400 + 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 mikeinterserv » Thu Dec 24, 2020 3:46 am

Thank you for your time and efforts
I know a lot more about htaccess now.

I tried your htaccess file (as is) but immediatly I get this error when trying to turn on seo urls
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Any idea why that is. I did not change you file in any way

Secondly I left ONLY the seo URL rewrite stuff in the htaccess files
The site then worked but the SEO urls were not working I checked the server setting to make sure it is enabled.
but the SEO urls will not work.

Yes now they work, it was my lack of understanding of how to make them AFTER they are enabled.
The htaccess file will only work will the seo rewrite code, if I add the other code back I still get the 500 error.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by sw!tch » Thu Dec 24, 2020 5:01 am

Post your .htaccess

Your store folder is Shop or lowercase shop ?
What do your DIR_APPLICATION and HTTP_SERVER values look like in your config.php?

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Location - USA

Post by mikeinterserv » Thu Dec 24, 2020 5:46 am

My htaccess file is EXACTLY the one posted above
It threw a 500 error - I removed everything except the SEO url rewrite code then it worked.
my config.php etc all looks correct
I am on shared web hosting
webroot is htdocs and OC is installed in a folder called Shop inside htdocs

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales
Who is online

Users browsing this forum: No registered users and 10 guests