Forums / General Questions / Script errors appearing on site after .htaccess www redirect

Script errors appearing on site after .htaccess www redirect

Views: 816

Results 1 to 3 of 3
27 Jul 2013, 9:23 PM
#1
randyrand avatar

randyrand

New Zenner

Join Date:
Mar 2010
Posts:
23
Plugin Contributions:
0

Script errors appearing on site after .htaccess www redirect

Hi there,

I was wondering if anybody has some advice on how to resolve some script errors that appear on our site when I uses .htaccess to redirect our site to a domain name with the www prefix.

We recently moved to a new server and upgraded to the most recent version of Zencart, and everything went smoothly, but we created the site with a domain name that didn't include the www prefix. Our SSL certificate requires the prefix, and after some research I realized an easy fix would be to use the .htaccess file to redirect the the site to display at all times with www. Bingo! Super easy.

But then of course, it wasn't that simple. Now this error appears on all our product pages:

! Error loading language file
http://oursite.com/includes/templates/ourtemplate/jscript/yoxview/lang/en.js

It appears this is the slider used on that came with our template and is used throughout the site, and for some reason it can no longer find the language file. I've tried to find references to that language file through the Developer's Tool Kit, but no luck.

I've poked around in the jquery.yoxview-2.21.js file to find the path for the language file, but I don't really understand what I'm looking at:

lang: "en", // The language for texts. The relevant language file should exist in the lang folder.
langFolder: yoxviewPath + "lang/",

Is there any way to edit this to include the www prefix? Or maybe should I look in the database with phpmyadmin?

27 Jul 2013, 9:26 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Script errors appearing on site after .htaccess www redirect

RandyRand:

we created the site with a domain name that didn't include the www prefix. Our SSL certificate requires the prefix
So ... just change the HTTP_SERVER and HTTPS_SERVER settings in your configure.php files to include the www. prefix.
Zen Cart will take care of the rest because it uses those to generate the clickable links and canonical URLs.

Skip messing with .htaccess.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 Jul 2013, 8:37 AM
#3
randyrand avatar

randyrand

New Zenner

Join Date:
Mar 2010
Posts:
23
Plugin Contributions:
0

Re: Script errors appearing on site after .htaccess www redirect

That's awesome! Worked like a charm. Thanks so much. :)