Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / General Questions / shopping cart is not working after i remove /store from via .htaccess

shopping cart is not working after i remove /store from via .htaccess

Started by lovets on 26 Jun 2012, 1:57 PM · Views: 1,370

Results 1 to 14 of 14
26 Jun 2012, 1:57 PM
#1
lovets avatar

lovets

New Zenner

Join Date:
Jun 2012
Posts:
23
Plugin Contributions:
0

shopping cart is not working after i remove /store from via .htaccess

Hi,

I was previously setting up my site under /store directory but what i really want was to remove the /store and just my domain URL itself. I have managed to do that by editing the .htaccess file.

But after my site went live, i discover that my shopping cart is not functioning as it was before. After i have log in an account, it will be automatically log out when i enter any of my sub categories for the products. This was not happening before i remove /store, the account would be kept log in all the way till checkout.

Can anyone advice what could be the cause or how i can fix this?
My store just went live and i have no idea how to solve this. Thanks a million!!

26 Jun 2012, 2:05 PM
#2
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: shopping cart is not working after i remove /store from via .htaccess

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

26 Jun 2012, 2:29 PM
#3
lovets avatar

lovets

New Zenner

Join Date:
Jun 2012
Posts:
23
Plugin Contributions:
0

Re: shopping cart is not working after i remove /store from via .htaccess

Hi,

yes, i have edit
define('DIR_WS_CATALOG', '/store/');
define('DIR_WS_HTTPS_CATALOG', '/store/');

to this:
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

I am not moving the content to another folder.
what i did is basically to remove the whole /store directory from https://www.mydomain.com/store to just https://www.mydomain.com.
shopping cart was working perfectly fine in https://www.mydomain.com/store but not in https://www.mydomain.com.

What happen is that, in https://www.mydomain.com, after i am logged into an account, my cart will show that i am logged in. however when i enter a sub category to add a product to my cart, i am automatically log out again and each time i want to add a product, i will have to log into my account again.

Please help!

26 Jun 2012, 3:54 PM
#4
lovets avatar

lovets

New Zenner

Join Date:
Jun 2012
Posts:
23
Plugin Contributions:
0

Re: shopping cart is not working after i remove /store from via .htaccess

I am guessing it might have been because i have accidentally overwrite the original .htaccess file. Is there anywhere that i can restore that? i have check my backup on cpanel but i don't seem to be able to find that file. Thanks

26 Jun 2012, 4:02 PM
#5
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: shopping cart is not working after i remove /store from via .htaccess

Did you edit both configure.php files as described in step 4?

I'm not sure any change to .htaccess was necessary.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

26 Jun 2012, 4:07 PM
#6
lovets avatar

lovets

New Zenner

Join Date:
Jun 2012
Posts:
23
Plugin Contributions:
0

Re: shopping cart is not working after i remove /store from via .htaccess

hi yes. edit both configure.php file as required.
i got the steps from here:
zencartblog.com/removing-a-subdirectory-from-your-stores-url

26 Jun 2012, 4:29 PM
#7
lovets avatar

lovets

New Zenner

Join Date:
Jun 2012
Posts:
23
Plugin Contributions:
0

Re: shopping cart is not working after i remove /store from via .htaccess

Or is there another way to work around it, say could there be a code to be added into the .htaccess file so that customers can stay log in throughout their out session till they log themselves out?

26 Jun 2012, 4:32 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: shopping cart is not working after i remove /store from via .htaccess

Something you've done has broken the normal session operation. What you're describing is not normal

When done according to the instructions posted here: http://www.zen-cart.com/content.php?160-i-have-installed-zen-cart-to-a-directory-how-do-i-rename-or-move-that-directory , there is no need for any .htaccess junk.

.
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.

26 Jun 2012, 4:33 PM
#9
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: shopping cart is not working after i remove /store from via .htaccess

There is no .htaccess file in the root directory of the current Zencart version. Unless you have some other things in yours that you need for programs other than Zencart, you might try removing it temporarily and see if things work then. The tutorial afo pointed to is the best way to move your store. I don't know why the author of the blog you mentioned thinks moving all your files and folders to the root is such a big deal. Takes maybe two seconds using FTP.

26 Jun 2012, 4:44 PM
#10
lovets avatar

lovets

New Zenner

Join Date:
Jun 2012
Posts:
23
Plugin Contributions:
0

Re: shopping cart is not working after i remove /store from via .htaccess

the only thing i did was to follow the instructions that was stated the the link i provided above, and then edit the configure.php files.
so i'm guessing the problem lies with the .htaccess part since i didn't change anything else.

what would you advice me to do now? is it safe for me to transfer all my files and folders to the root now?

26 Jun 2012, 5:10 PM
#11
drbyte avatar

drbyte

Sensei

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

Re: shopping cart is not working after i remove /store from via .htaccess

Simple: if you followed unofficial instructions which didn't work, undo them and then use the official instructions instead.

In your case that would appear to be:

  1. Remove the .htaccess changes you made.
  2. Follow the FAQ article from the Zen Cart site, as I mentioned earlier ... which directs you about moving files via FTP and editing the configure.php files ... some of the configure.php changes are already done from your earlier edits, but there are more to do.

.
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.

26 Jun 2012, 5:45 PM
#12
lovets avatar

lovets

New Zenner

Join Date:
Jun 2012
Posts:
23
Plugin Contributions:
0

Re: shopping cart is not working after i remove /store from via .htaccess

would that actually help to solve the issue of automatic log out by the site?

26 Jun 2012, 6:04 PM
#13
lovets avatar

lovets

New Zenner

Join Date:
Jun 2012
Posts:
23
Plugin Contributions:
0

Re: shopping cart is not working after i remove /store from via .htaccess

DrByte:

Simple: if you followed unofficial instructions which didn't work, undo them and then use the official instructions instead.

In your case that would appear to be:

  1. Remove the .htaccess changes you made.
  2. Follow the FAQ article from the Zen Cart site, as I mentioned earlier ... which directs you about moving files via FTP and editing the configure.php files ... some of the configure.php changes are already done from your earlier edits, but there are more to do.

i have undo all the changes and shopping cart working fine again.
just to double check, when i move all the folders and files from the subdirectory to the root, there will be files that needs to be overwritten, for instance, the index.php file. Is that alright?

26 Jun 2012, 9:27 PM
#14
drbyte avatar

drbyte

Sensei

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

Re: shopping cart is not working after i remove /store from via .htaccess

Yes. Before you do it, move all your existing "root" files into some other folder for safekeeping. Your Zen Cart will not use them, and you don't want them competing with your Zen Cart operation.

.
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.