Zen Cart Logo
Forums / General Questions / URL shows the /ZenCart folder. How to remove?

URL shows the /ZenCart folder. How to remove?

Locked

Views: 1,894

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
10 Jul 2008, 2:22 PM
#1
cheapstairparts avatar

cheapstairparts

Zen Follower

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

URL shows the /ZenCart folder. How to remove?

My zencart is installed in a folder, instead of the root directory.

http://www.cheapstairparts.com/ZenCart

I have a redirect, so if you just type in cheapstairparts.com it will redirect you to the folder... but I don't want the /ZenCart to show up.

As I understand, you can edit the .htaccess file to fix this, but I have no idea how to do this.

Can anybody look at this code and help me?

RewriteEngine on
RewriteCond %{HTTP_HOST} ^cheapstairparts.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.cheapstairparts.com$
RewriteRule ^/?$ "http\:\/\/www\.cheapstairparts\.com\/ZenCart" [R=301,L]
10 Jul 2008, 2:53 PM
#2
pensandpencils avatar

pensandpencils

New Zenner

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

Re: URL shows the /ZenCart folder. How to remove?

Just make that folder the root folder of that website.

That'll do it.

What kind of server you using?

10 Jul 2008, 3:10 PM
#3
cheapstairparts avatar

cheapstairparts

Zen Follower

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

Re: URL shows the /ZenCart folder. How to remove?

I am on shared hosting, because I have other domains, and changing root folders is not allowed.

My only option is editing this .htaccess file, and it is way above my level.

10 Jul 2008, 3:30 PM
#4
stevesh avatar

stevesh

Black Belt

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

Re: URL shows the /ZenCart folder. How to remove?

You can't copy the contents of /zencart into the root of that domain and edit the two configure.php files?

10 Jul 2008, 4:06 PM
#5
pensandpencils avatar

pensandpencils

New Zenner

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

Re: URL shows the /ZenCart folder. How to remove?

Maybe change the folder title to '.' or 'store' so its a little more palatable if your hosting package is that limiting.

Or maybe get a hosting package where you can control this sort of thing ;-)

10 Jul 2008, 7:01 PM
#6
cheapstairparts avatar

cheapstairparts

Zen Follower

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

Re: URL shows the /ZenCart folder. How to remove?

well I can try to move everything to the root folder and edit the config files, is there anything else I need to change other than config files before I transfer?

10 Jul 2008, 7:21 PM
#7
stevesh avatar

stevesh

Black Belt

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

Re: URL shows the /ZenCart folder. How to remove?

Nope. That should do it - all you have to change is the paths, so just remove the /zencart from them and you should be good. You'll have to change permissions on the configure files to change them, of course.

I assume that in your previous post you meant that you couldn't point a domain to a subdirectory of another domain. My host doesn't allow that either on shared servers, and I think it's a good policy.

11 Jul 2008, 12:19 AM
#8
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: URL shows the /ZenCart folder. How to remove?

CheapStairParts:

My zencart is installed in a folder, instead of the root directory.

http://www.cheapstairparts.com/ZenCart

I have a redirect, so if you just type in cheapstairparts.com it will redirect you to the folder... but I don't want the /ZenCart to show up.

As I understand, you can edit the .htaccess file to fix this, but I have no idea how to do this.

Can anybody look at this code and help me?

RewriteEngine on
RewriteCond %{HTTP_HOST} ^cheapstairparts.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.cheapstairparts.com$
RewriteRule ^/?$ "http://www.cheapstairparts.com/ZenCart" [R=301,L]


Try this rewrite mod it works for me.

ReadWrite Rules SW 05.07.08

ZenCart installed in subdirectory but want URL to appear as root

Options -Indexes
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} !^www.mysite.com$ [NC]
RewriteRule .* http://www.mysite.com/ [L,R=301]
RewriteRule ^$ store/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/store%{REQUEST_URI} -f
RewriteRule .* store/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* store/index.php?q=$0 [QSA]

Of course you would change **mysite** to your url and **store** to your subdirectory name

Next:
I edited includes/configure.php and changed the following from the install.
Code::

define('DIR_WS_HTTP_CATALOG', '/store/');
define('DIR_WS_HTTPS_CATALOG', '/store/');

To this:
Code::

define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');


As for the admin config I made no changes.

NOTE: MAKE BACKUPS

Skip
11 Jul 2008, 1:53 PM
#9
cheapstairparts avatar

cheapstairparts

Zen Follower

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

Re: URL shows the /ZenCart folder. How to remove?

This "did" work but the CSS was not working after I did it.

I think I will just leave the /ZenCart on the URL, so far it isn't worth the trouble to fix.