Zen Cart Logo
Forums / Installing on a Windows Server / How to direct domain to > /store/ (directory)

How to direct domain to > /store/ (directory)

Locked

Views: 5,762

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
25 Jan 2007, 6:42 AM
#1
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

How to direct domain to > /store/ (directory)

Hi,

Can someone please tell me how to direct a domain to /catalog/ or /store/ folder when someone types the domain name.

Ei; If I type xyz.com

I want it to go to xyz.com/store (this is where all the files are) nothing in the root directory!

I know I can make go there with refresh meta tag but wasn't sure if thats the zen way and also wasn't sure if I would get penalize by Google if I uesd refresh tag. And will have other consequences?

Thanks

25 Jan 2007, 6:55 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to direct domain to > /store/ (directory)

Why not move the files to the root?

25 Jan 2007, 6:55 AM
#3
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: How to direct domain to > /store/ (directory)

i wouldn't suggest the refresh meta tag.. it 'breaks the back button' (meaning if the user wanted to go back.. they'd hit that refresh page again and end up at your store.. etc

I would make a file called "index.php" and put it into the root directory. Inside this file, have the following code:

<?php
header("location:http://www.xyz.com/store");
?>

and it should work just fine :)

25 Jan 2007, 6:59 AM
#4
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

Kobra - Reason is client said they may have later have a ' intro page' .

Samad64 - good suggestion . If I do that <?php header("location:http://www.xyz.com/store"); ?>

is that mean when I submit my site to search engines I would only submit -

ei; xyz.com

OR xyz.com/store ??

Thank you both

25 Jan 2007, 7:04 AM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to direct domain to > /store/ (directory)

Optionally, in htaccess you could direct opening to a home_page.html to be loaded first over the index.php that also exists at the root if Zen Cart were at the root

25 Jan 2007, 7:08 AM
#6
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

Yes that's a god idea when client want the intro page.

But I need advise to this now

when I submit my site to search engines I would only submit -

ei; xyz.com

OR xyz.com/store ??

Thanks

25 Jan 2007, 7:11 AM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to direct domain to > /store/ (directory)

If you move it to the root now then submit as xyz.com and avoid the rush later as you do not want to change it and start over with ranking

25 Jan 2007, 7:13 AM
#8
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

I cant move it now a client wants it to be as is xyz.com/store for time being.

25 Jan 2007, 7:24 AM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to direct domain to > /store/ (directory)

When I asked this your reply was:

Kobra - Reason is client said they may have later have a ' intro page' .
With no mention of the client wants it that way. As a provider I would inform the client that being at the root is preferable and if they later want an intro page that there are methods to accomplish this

25 Jan 2007, 7:34 AM
#10
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

Ok Thanks ,

I'll give it a go and see if I can convince them.. I totally agree with you.

25 Jan 2007, 7:42 AM
#11
tbontes avatar

tbontes

New Zenner

Join Date:
Aug 2005
Posts:
1
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

I simply used my server to redirect the .com site to the shop. This way visitors type in the web site .com URL and are instantly redirected to ZenCart). I use the cart as a member registration module and use an EZPage link back to the .com site. But you may have to registere a domain name and leave it an empty site with a redirect to your shop. Does this help?

Warm regards all the way from beyond the Black Stump!

25 Jan 2007, 7:47 AM
#12
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

hi

Great to hear. Your suggestion really does not apply to my current circumstances but also good alternative.

Looks like I need to speak with my client and change the root from xyz.com/store to xyz.com/

The only reason I want is that I am concern about the search engine submissions As some will penalize you for redirects.

Thanks anyway

27 Jan 2007, 2:44 AM
#13
magicpants avatar

magicpants

Zen Follower

Join Date:
Aug 2005
Posts:
314
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

I'm no expert on this, in fact I'm trying to find the "right" way to redirect from our webpage.com address to webpage.com/store. Up until now, I've been using the

<?php header("location:http://www.xyz.com/store");

method suggested in this thread. However, I would proceed with caution as we've had a page rank of 0 for the past 6 months! The reason we don't move our shop to the root is because it's been set up like this and working properly for months, so I'd rather avoid spending a ton of time trying to move the folder and hunting down all the problems.

I believe this redirect is the reason for our bad page ranking, and from what I've heard on other threads, search engines don't like this kind of redirect. Could someone please advise on the way to do this in .htaccess file?

I'll keep searching and if I come up with the answer, I'll post it here.

27 Jan 2007, 3:37 AM
#14
magicpants avatar

magicpants

Zen Follower

Join Date:
Aug 2005
Posts:
314
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

Okay, I've tracked down some .htaccess methods. Here are a list of the ones that SHOULD work for those out there trying to do the same thing:

Just create a text doc called .htaccess and put 1(!) of these in that file then upload to your root. Of course, change the yourwebsite.com to your website address, and the catalog folder to whatever you've called yours.

redirect 301 /index.php http://www.yourwebsite.com/catalog/index.php

DirectoryIndex catalog/index.php

Neither of these worked for me. In fact, I've tried a bunch of different syntaxes and methods and my htaccess file seems completely ignored. I made sure it was transfered in ASCII and set the permissions to 644 as was suggested, but nothing happens.

Can someone please enlighten me on what I'm doing wrong? Or what else I can check on our server? Yes, we're on an Apache Fedora server. I noticed that mod_rewrite was loaded, and url rewrite was set to "a=href,area=href,frame=src,form=,fieldset=" All gibberish to me, unfortunately.

27 Jan 2007, 6:46 AM
#15
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: How to direct domain to > /store/ (directory)

magicpants:

Okay, I've tracked down some .htaccess methods. Here are a list of the ones that SHOULD work for those out there trying to do the same thing:

Just create a text doc called .htaccess and put 1(!) of these in that file then upload to your root. Of course, change the yourwebsite.com to your website address, and the catalog folder to whatever you've called yours.

redirect 301 /index.php http://www.yourwebsite.com/catalog/index.php

DirectoryIndex catalog/index.php

> 
> Neither of these worked for me.  In fact, I've tried a bunch of different syntaxes and methods and my htaccess file seems completely ignored.  I made sure it was transfered in ASCII and set the permissions to 644 as was suggested, but nothing happens.  
> 
> Can someone please enlighten me on what I'm doing wrong?  Or what else I can check on our server?  Yes, we're on an Apache Fedora server.  I noticed that mod_rewrite was loaded, and url rewrite was set to "a=href,area=href,frame=src,form=,fieldset="  All gibberish to me, unfortunately.

magicpants

change this:

redirect 301 /index.php http://www.yourwebsite.com/catalog/index.php


to read:

redirect 301 / http://www.yourwebsite.com/catalog/


this way it should work. The previous way, it would only work if you went to yourdomain.com/index.php, not if you went to it without (about 95% sure of that)

i also think you're right regarding the index.php header/redirect method. i had forgotten about the effect it had on my page rank when i had used it previously.. thanks for reminding me about that!
27 Jan 2007, 4:25 PM
#16
magicpants avatar

magicpants

Zen Follower

Join Date:
Aug 2005
Posts:
314
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

Thanks samad64 for the advice -- unfortunately it doesn't change anything. I really think the htaccess is just being completely ignored. I'm sure I've done everything correctly, unless I'm supposed to add more than 1 line to it (just writing the redirect line at the top of the file).

But, is there some server setting that could be wrong? Or some other reason the file isn't being looked at? I couldn't find anything on google or the forums so I'm at a total loss...

2 Feb 2007, 3:32 AM
#17
magicpants avatar

magicpants

Zen Follower

Join Date:
Aug 2005
Posts:
314
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

For anyone else suffering from the problem I had (i.e. the htaccess file being ignored), I had to change one line in our httpd.conf file on the server. From
AllowOverride None
to
AllowOverride All

Hope that saves somebody else some time!

25 Apr 2008, 3:37 PM
#18
toritaiyo avatar

toritaiyo

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

Thanks Magicpants and Samad64,:clap:

Very useful info for me.

On thing though that I will mention in case it is the same for anyone else reading...
I found that

redirect 301 / http://www.mysite.com/store/

rendered the URL as
http://www.mysite.com/store/store/store/store/store/ (infinity)
And firefox said:

The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

So I changed it to
redirect 301 /index.html http://www.mysite/store/

And it worked fine.

27 Apr 2008, 6:54 PM
#19
omglia avatar

omglia

New Zenner

Join Date:
Apr 2008
Posts:
14
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

This is working great for me when I change the HT access page, it's redirecting http://omglia.com to http://omglia.com/catalog but the problem is when I click the "Main Page" link (I changed it from HOME) at the top and bottom and breadcrumb trail ... it redirects to "Index of /catalog" with a list of all of my folders and whatnot, with the url at the top http://omglia.com/catalog . Help? Where can I change where that links to?

27 Apr 2008, 7:04 PM
#20
omglia avatar

omglia

New Zenner

Join Date:
Apr 2008
Posts:
14
Plugin Contributions:
0

Re: How to direct domain to > /store/ (directory)

Nevermind I figured it out by changing tpl_header.php that I found in this thread:
http://www.zen-cart.com/forum/showthread.php?t=93221
now it works :)