Post by evilfx » Tue Mar 15, 2016 8:42 pm

Hello,

If i access my stores admin url, or click on add to cart on the frontpage i get a popup with:

Error
Undefined

This happens ONLY if i access my websites without the www.

My websites are:

www.beleza21.com (OC 2.1.0.2) and www.kawibikini.com (latest version of OC)

Do you know how i can fix this?

Best regards,
evilfx

New member

Posts

Joined
Fri Mar 23, 2012 8:28 am

Post by OSWorX » Tue Mar 15, 2016 10:19 pm

evilfx wrote:Do you know how i can fix this?
Yes.

To be serious, you should avoid the calling with AND without www
The error you have is based on this:
Quellübergreifende (Cross-Origin) Anfrage blockiert: Die Gleiche-Quelle-Regel verbietet das Lesen der externen Ressource auf http://www.beleza21.com/catalog/view/ja ... f2?v=4.4.0. (Grund: CORS-Kopfzeile 'Access-Control-Allow-Origin' fehlt).

Line 0

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by evilfx » Wed Mar 16, 2016 1:33 am

Hi Osworx, thanks for your reply.
Sometimes my browser auto-completes without the "www.". And then i get that error. I'm afraid my customers might see this error as well.

From your reply i didn't quite get it how i can fix it? Could you be more accurate as to what the fix is?

Is this something that happens to everybody?

New member

Posts

Joined
Fri Mar 23, 2012 8:28 am

Post by MariOiraM » Wed Mar 16, 2016 3:46 am

Sory for outside of theme question, what is your slideshow called?
Is it aditional or it comes with theme? Please PM me when you can.

Unior orodje | Makita orodje| Dewalt orodje


New member

Posts

Joined
Sun Apr 19, 2015 12:40 am


Post by OSWorX » Wed Mar 16, 2016 3:55 am

evilfx wrote:Hi Osworx, thanks for your reply.
Sometimes my browser auto-completes without the "www.". And then i get that error. I'm afraid my customers might see this error as well.

From your reply i didn't quite get it how i can fix it? Could you be more accurate as to what the fix is?

Is this something that happens to everybody?
Fixing that can be done via 2 methods:

1. if you are using Plesk, simply define that there that you want URLs with / or without www (do not know if that can be done with other server panels like cPanel etc.)
2. simply add 2 lines to your .htaccess (either with or without www)

With both methods you are fine.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by evilfx » Wed Mar 16, 2016 7:12 pm

2. simply add 2 lines to your .htaccess (either with or without www)

how do i do this Osworx?

Sorry for all the trouble but i'm new at this.

New member

Posts

Joined
Fri Mar 23, 2012 8:28 am

Post by OSWorX » Wed Mar 16, 2016 7:24 pm

To allow only non-www pages, add this here into your .htaccess

Code: Select all

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

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by evilfx » Wed Mar 16, 2016 8:50 pm

if i do that, i get the error all the time because it is without www. that i get the error.

i changed it to:
RewriteCond %{HTTP_HOST} ^beleza21.com [NC]
RewriteRule (.*) http://www.beleza21.com/$1 [R=301,L]
and now it is always www.beleza21.com and it works.

Thanks!

New member

Posts

Joined
Fri Mar 23, 2012 8:28 am

Post by OSWorX » Wed Mar 16, 2016 10:35 pm

Important that it works.

While a 'www' is not really needed, it is just a subdomain technically.
So there is something else wrong.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by princerocky » Fri Apr 29, 2016 1:11 pm

HI Osworkx,

I m also getting same error for my new developed site ..
If i access my store and click on add to cart on the front page i get a pop up with:

Error
Undefined

This happens ONLY if i access my websites without the www. on mobile

My websites are:

www.kuchdeals.com (OC 2.2.0.0) and www.waydeal.com (OC 2.1.0.2)

Do you know how i can fix this?
Pls help

Newbie

Posts

Joined
Fri Apr 29, 2016 1:09 pm

Post by zezjulin » Mon May 09, 2016 7:00 pm

1. make redirect (with or without www) into your .htaccess
2. into config.php (main and admin folders) add or delete www. in "define('HTTP_SERVER', 'http://www.yoursite.com/');"

Newbie

Posts

Joined
Mon May 09, 2016 6:48 pm

Post by dragonfly-ie » Mon May 30, 2016 7:50 am

zezjulin wrote:1. make redirect (with or without www) into your .htaccess
2. into config.php (main and admin folders) add or delete www. in "define('HTTP_SERVER', 'http://www.yoursite.com/');"
That's it in a nutshell. Cheers.

[keywords=undefined+error+in+subdomain+www]

Dum spiro spero.


User avatar
New member

Posts

Joined
Sat Nov 09, 2013 2:31 am


Post by himanshug.com » Wed Jul 13, 2016 10:23 pm

Hello,
Thanks for your conversation and observations but seriously I got solution from here, as I read that this is going because of www and someone said that www. is a sub-domain and that strikes in mind that yes, a sub-domain can be a issue as in some CMS the file paths are used according to the installation directory and its URL and thus, creates an issue with most common sub-domain i.e. www.

Well, making a permanents re-direct without using www helps a lot in case site is installed on without www directory and vice-versa in case of if site is installed in with www directory.

Newbie

Posts

Joined
Wed Jul 13, 2016 10:18 pm

Post by onedeveloper » Mon Jul 18, 2016 10:28 pm

Correção

Altere os arquivos config.php

De
define('HTTP_SERVER', 'http://seudominio.com.br/admin/');
define('HTTP_CATALOG', 'http://seudominio.com.br/');

Para
define('HTTP_SERVER', '/admin/');
define('HTTP_CATALOG', '/');

Newbie

Posts

Joined
Mon Jul 18, 2016 10:25 pm

Post by waniegreeny » Mon Sep 19, 2016 5:51 pm

OSWorX wrote:To allow only non-www pages, add this here into your .htaccess

Code: Select all

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

HI Osworkx,

I m also getting same error for admin site. If i access admin page and click on view latest order i get a pop up with:

Error
Undefined


My websites are:

www.dinarglobal.com (OC 2.2.0.0) and admin page www.dinarglobal.com/admin

Do you know how I can fix this?
Pls help

Newbie

Posts

Joined
Wed Aug 17, 2016 10:54 am

Post by srvec » Sun Sep 25, 2016 3:49 am

hello everybody
i hav a problem in location side; specialy when i choose morocco as location for my store.

it give me error unexeption token < in JSON position 3581.

can you help me ??

Newbie

Posts

Joined
Sun Sep 25, 2016 3:45 am

Post by mrfifagamer » Tue Nov 01, 2016 11:07 pm

onedeveloper wrote:Correção

Altere os arquivos config.php

De
define('HTTP_SERVER', 'http://seudominio.com.br/admin/');
define('HTTP_CATALOG', 'http://seudominio.com.br/');

Para
define('HTTP_SERVER', '/admin/');
define('HTTP_CATALOG', '/');
This worked for me, thanks!

New member

Posts

Joined
Sun Aug 23, 2015 6:34 pm

Post by reginamor » Sun Apr 23, 2017 7:55 pm

onedeveloper wrote:
Mon Jul 18, 2016 10:28 pm
Correção

Altere os arquivos config.php

De
define('HTTP_SERVER', 'http://seudominio.com.br/admin/');
define('HTTP_CATALOG', 'http://seudominio.com.br/');

Para
define('HTTP_SERVER', '/admin/');
define('HTTP_CATALOG', '/');
thank you so much!!!!! ;D ;D ;D ;D

User avatar
Active Member

Posts

Joined
Wed Sep 21, 2011 4:44 am
Location - GB

Post by halitorak72 » Thu Mar 08, 2018 2:41 am

waniegreeny wrote:
Mon Sep 19, 2016 5:51 pm
OSWorX wrote:To allow only non-www pages, add this here into your .htaccess

Code: Select all

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

HI Osworkx,

I m also getting same error for admin site. If i access admin page and click on view latest order i get a pop up with:

Error
Undefined


My websites are:

www.dinarglobal.com (OC 2.2.0.0) and admin page www.dinarglobal.com/admin

Do you know how I can fix this?
Pls help
Hello everybody,

I have same problem. When I click wiev latest order on admin page, get a pop up like this:

Error
Undefined

Please help me...

Newbie

Posts

Joined
Thu Mar 08, 2018 2:37 am
Who is online

Users browsing this forum: No registered users and 30 guests