Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Installing Zen Cart / Installing on a Linux/Unix Server / Change existing site from sub directory to the root of the web site

Change existing site from sub directory to the root of the web site

Started by fjbern1943 on 22 Jun 2015, 6:15 PM · Views: 3,687

Results 1 to 20 of 22
22 Jun 2015, 6:15 PM
#1
fjbern1943 avatar

fjbern1943

Zen Follower

Join Date:
Apr 2015
Location:
United States
Posts:
144
Plugin Contributions:
0

Post #1 by fjbern1943

I installed zencart 1.54 in a subdirectory "root/storefron"t and now have changed my mind and would like to re-install the store in the root directory. Is there an existing thread which explains how to do this, or can someone help.

22 Jun 2015, 6:39 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #2 by mc12345678

fjbern1943:

I installed zencart 1.54 in a subdirectory "root/storefron"t and now have changed my mind and would like to re-install the store in the root directory. Is there an existing thread which explains how to do this, or can someone help.

Yes, there is an entire FAQ on this process. One thing that might help with further doing this is to address if the only thing to do is to change the directory or is there a desire to also address other things like website rankings as well.

In the interim, see: https://www.zen-cart.com/content.php?160-i-have-installed-zen-cart-to-a-directory-how-do-i-rename-or-move-that-directory

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

22 Jun 2015, 7:33 PM
#3
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Post #3 by lruskauff

mc12345678:

Yes, there is an entire FAQ on this process. One thing that might help with further doing this is to address if the only thing to do is to change the directory or is there a desire to also address other things like website rankings as well.
Could you further expand on how it relates to website rankings? Thank you.
Linda

22 Jun 2015, 7:46 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #4 by mc12345678

lruskauff:

Could you further expand on how it relates to website rankings? Thank you.
Linda

I'll try, though believe it or not there are others that could say it in more words than me.

Ranking "groups" know your site and product by URI. Change the address (remove/add a directory) without telling them where it went (or using a method that resolves to the previous product/page), and they can't find the product (and site) where it was at that gave it it's ranking. Can't find, then have to restart with ranking process, possibly competing with onesself for a short period of time until the old records are kicked out.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

22 Jun 2015, 8:10 PM
#5
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Post #5 by lruskauff

Thank you and lol, "more words than you". I just changed my site from dynamic to static URL's after 6+ years. I figure I couldn't go much lower in rankings than I was. Sales aren't up yet (it has been 1 month) but more of my pages are getting indexed and crawled, so I think that is better. Now I see I should have gotten rid of the subdirectory /shop/ too and am thinking "should I do it again". My gut say no, but I'd be interested in what you experts think. So I am asking if it is worth it to change my directories once again from thestitchsanctuary dot com / shop to thestitchsanctuary dot com? Any opinions :P (and I don't mind lengthy ones).

22 Jun 2015, 8:48 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #6 by mc12345678

So part of my nswer addressed the change you made. The items on your site are still locatable by the ZC standard URI, which means existing/previous links still work and are locateable.

There are those that have preferences, and those that have reasons. I find/think that if ZC is the sole site, then there should not be a sub-directory seen webside. Sort of begs the question of what is in that root directory, or what else is hosted? Why am I directed to here instead of the mainpage, etc....

Now I say all that too from a standpoint ofintroducing ZC after the main site was in place where at the time someone else controlled the main site. At that time ZC was installed to a "published" sub-directory. That main site is going to be going away though...it is going to get it's content integrated into ZC, and then the applicable pages are going to be "redirected" to the ZC equivalent... And the store side will remain locateable as well, so no expectations of "issues".

As to the dynamic/static site uris, be ready to hear about it. :P

Other threads in here about moving directories, more than likely to be able to count... Just need to search even if starting with related threads at the bottom of this post.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

23 Jun 2015, 6:28 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,924
Plugin Contributions:
24

Post #7 by dbltoe

So... If your store were in a mall, would you want it to be on the main thoroughfare or inside of another store? The myth of needing to be in /shop, /store, etc. goes back to the mythological times of landing pages and shopping carts that did nothing but check you out.

And.... Speaking of doing nothing. Changing your site increased the indexing and crawling NOT the changing of the URIs. Had to add that for MCs> As to the dynamic/static site uris, be ready to hear about it. :pOnce an SE sees something new in the site or sitemap, the SE will crawl to see what else has changed and index what has changed. A reason ONLY for keeping content current and relevant.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

23 Jun 2015, 8:01 PM
#8
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Post #8 by lruskauff

dbltoe:

So... If your store were in a mall, would you want it to be on the main thoroughfare or inside of another store? The myth of needing to be in /shop, /store, etc. goes back to the mythological times of landing pages and shopping carts that did nothing but check you out.

Ok. So I read "how to move directories" and it makes sense if I was moving from say /shop/ to /hop/ . But I'm actually getting rid of the /shop/ directory, so do I just dump the contents into the /public_html/? That seems messy. I understand that I also have to edit my configs and make sure my cache path is correct.

And.... Speaking of doing nothing. Changing your site increased the indexing and crawling NOT the changing of the URIs. Had to add that for MCsOnce an SE sees something new in the site or sitemap, the SE will crawl to see what else has changed and index what has changed. A reason ONLY for keeping content current and relevant.

Well, I was always changing my site, adding and deleting products, changing the front page. But that didn't change the indexing in the past. At least it didn't seem to.

23 Jun 2015, 8:21 PM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #9 by mc12345678

Well, only "messy" if that's the structure of your public_html folder. :) but, that said may I reiterate:

should not be a sub-directory seen webside

The contents can be in a folder, provided the web address points to that folder... But there are still things to consider such as existing .htaccess rules and any new ones that get applied...

Or the "popular" method of having all of the web facing content in the public_html folder...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

23 Jun 2015, 8:38 PM
#10
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Post #10 by lruskauff

mc12345678:

Well, only "messy" if that's the structure of your public_html folder. :) I can't help it, I let too many people in the front door over the years, each one dropping a file here or there. Now I have to figure out if they are needed before I delete them.

but, that said may I reiterate:

The contents can be in a folder, provided the web address points to that folder... But there are still things to consider such as existing .htaccess rules and any new ones that get applied...

I guess I'm not following how web addresses work cause my store is in a folder now , /shop/ so my site points to it by thestitchsanctuary.com/shop

But I want to be able to just refer to it as thestitchsanctuary.com.

Are you saying that is possible?

Or the "popular" method of having all of the web facing content in the public_html folder...
remember, I'm not good with indirect. :). Are you saying popular good or popular bad.

Right now I have my blog folder, and a few backup folders in my public_html directory. I was told to set up my test directory as a subdominant, which I did but it's files are in the public html too. So I do editing of the htaccess rules when I need to run a test. I don't like having to do that but wasn't sure how else to do it.

23 Jun 2015, 9:06 PM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #11 by mc12345678

So your domain points to something like:

/home/username/public_html

Most cPanels have the ability to modify to where the domain points, which would mean that you could modify the domain to point to: /home/username/public_html/shop

The user would see your domain name, but the subfolder of shop would be where the content was/is. Therefore, the site could be in a folder, but the user would not see that folder. This is similar to what you should have had to do for the subdomain that you setup where you identified that the subdomain could be located in a particular folder. If that folder was specifically your public_html and not a subfolder off of it, then yes there is a mess. :)

Popular good versus bad? Well, everyone has their preference and reason and method of managing. I've worked significantly from two different hosts, neither specifically has a public_html folder, but they have "defaults" for all that they do. Is it good to follow a "social" norm? Sure, that way everyone can talk from the same page... It is also why certain things are used/stated for certain conditions and expectations on this forum. That way everyone can relate and work from a common basis. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

23 Jun 2015, 10:22 PM
#12
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Post #12 by rodg

lruskauff:

I can't help it, I let too many people in the front door over the years, each one dropping a file here or there. Now I have to figure out if they are needed before I delete them.

If your 'site' consists of Zencart and nothing else, and the site resides in
/public_html/shop/ then any other files in the /public_html/ folder can be deleted.

HOWEVER, do yourself a favour and don't just go head first into deleting everything. In fact I suggest you delete nothing. Either create an 'archive' of the files first, or make a local backup of them. Then and only then should you consider deleting anything.

If you delete 'too much' things will surely break, but at least you'll be able to restore the files that are needed. As I say though, if you are only using zencart and its files are in a sub-folder, then everything (other than the sub folder) can be deleted.

lruskauff:

I guess I'm not following how web addresses work cause my store is in a folder now , /shop/ so my site points to it by thestitchsanctuary.com/shop

But I want to be able to just refer to it as thestitchsanctuary.com.

Are you saying that is possible?

Sure it is.

lruskauff:

Now I have to figure out if they are needed before I delete them.

Back 'em up, then delete from the server. Check that the site is fully functional, then move (don't copy) all of the files out of /public_html/shop/ into /public_html/

Edit the config files to match the new location. Check that all is OK.

The reason I say move rather than copy, is because if you make a copy and don't get the configure file changes 100% correct you could end up with a site that appears to be fully functional, but is in fact pulling some data from the relocated files, and some data from the /shop/ folder. This can be a bit of a nightmare to both identify and resolve. In contrast, if you move the files the /shop/ folder will be empty, so now if you don't get the config files 100% correct the store simply won't function - But at least you'll know where to look for a solution - The config files.

lruskauff:

Right now I have my blog folder, and a few backup folders in my public_html directory.

Are you using the blog? If not, archive/backup the folder and delete it. If you are using it, leave it where it is.

It is bad practice to keep backup files in any 'publicly accessible' folder, that includes the /public_html/ folder and all of its sub folders.

lruskauff:

I was told to set up my test directory as a subdomain,

I've no desire to confuse you, but directories/folders and domains/subdomains are entirely different things that have no direct relationship with each other.

domains/subdomains relate to the URL/URI that people need to use to access your site.
directories/folders relate to the physical location of the files on the server.

If you take a good look at the ZenCart configuration files you'll note that some 'defines' read like "DIR_FS_" and others are like "DIR_WS_"
These denote the 'File System' (where the files reside on the server) and the 'Web Server" (The URL/URI that people need to use to access the site) respectively.

lruskauff:

which I did but it's files are in the public html too. So I do editing of the htaccess rules when I need to run a test. I don't like having to do that but wasn't sure how else to do it.

Although not strictly true, a web server will only function with files placed in the /public_html/ folder and its subfolder. On some systems this folder will be called /www/, /docroot/ and even \inetpub\
The exact name depends on what the server itself, and how the server admin has configured things. For the majority of people this can't be changed. Folders that reside above these defined folders are inaccessible to the webserver itself. This is a security measure to prevent people accessing the critical system files via a web browser.

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

24 Jun 2015, 3:51 AM
#13
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Post #13 by lruskauff

mc12345678:

So your domain points to something like:

/home/username/public_html

Most cPanels have the ability to modify to where the domain points, which would mean that you could modify the domain to point to: /home/username/public_html/shop

The user would see your domain name, but the subfolder of shop would be where the content was/is. Therefore, the site could be in a folder, but the user would not see that folder. This is similar to what you should have had to do for the subdomain that you setup where you identified that the subdomain could be located in a particular folder. If that folder was specifically your public_html and not a subfolder off of it, then yes there is a mess. :)

Ok, I went to my CPANEL and there is a "script" or "button" that I press and fill in the blanks for where I want my subdomain and blog to point. So I actually don't see what goes on behind the scenes. But I asked them (hosts) and they said I could do it by putting the following in my htaccess file.

The code is:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain-name.com$
RewriteCond %{REQUEST_URI} !folder/
RewriteRule (.*) /folder/$1 [L]

I will assume that I would put it at the top before all other rewrites but will it interfer with my Ceon URI Mapping rewrite rules as they stand? My current code besides the CEON URI Mapping is:

#used cpanel to add the following 301 redirects

###############################################################################

RewriteCond %{HTTP_HOST} ^thestitchsanctuary\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.thestitchsanctuary\.com$
RewriteRule ^/?$ "https\:\/\/thestitchsanctuary\.com\/shop" [R=301,L]

RewriteCond %{HTTP_HOST} ^stitchsanctuary\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.stitchsanctuary\.com$
RewriteRule ^/?$ "https\:\/\/thestitchsanctuary\.com\/shop" [R=301,L]

RewriteCond %{HTTP_HOST} ^thequiltsanctuary\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.thequiltsanctuary\.com$
RewriteRule ^/?$ "https\:\/\/thestitchsanctuary\.com\/shop" [R=301,L]

I would be removing all of that. The first because it will no longer be needed and the next two because I read that those just cause google to split the rankings between them therefore hurting my rankings.

This is my CEON code:

# ONLY rewrite URIs beginning with /shop/
RewriteCond %{REQUEST_URI} ^/shop/ [NC]
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite any URIs for some, popular specific file format extensions,
#   which are not covered by main file extension condition above
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
# Don't rewrite any URIs for some specific file format extensions,
#   which are not covered by main file extension condition above
#   Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
#RewriteCond %{REQUEST_URI} !\.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/shop/myadmin [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/shop/editors/ [NC]
# Don't rewrite logs directory
RewriteCond %{REQUEST_URI} !^/shop/logs/ [NC]
# Don't rewrite sitemap directory
RewriteCond %{REQUEST_URI} !^/shop/sitemap/ [NC]
# Don't rewrite cgi-bin directory
RewriteCond %{REQUEST_URI} !^/shop/cgi\-bin/ [NC]
# Don't rewrite bmz_cache directory
RewriteCond %{REQUEST_URI} !^/shop/bmz_cache/ [NC]
# Handle all other URIs using Zen Cart (its index.php)
RewriteRule .* shop/index.php [QSA,L]

## END CEON URI MAPPING REWRITE RULE

I don't think I would want the /shop/ rewrites but not sure how to format the one that just says /shop/ . Would it be just "/" (no quotes, first rewrite cond). Or can I just rre-run the ceon configuration script again.

Popular good versus bad? Well, everyone has their preference and reason and method of managing. I've worked significantly from two different hosts, neither specifically has a public_html folder, but they have "defaults" for all that they do. Is it good to follow a "social" norm? Sure, that way everyone can talk from the same page... It is also why certain things are used/stated for certain conditions and expectations on this forum. That way everyone can relate and work from a common basis. :)

Thanks. (Please tell me I didn't expose anything)

24 Jun 2015, 4:03 AM
#14
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #14 by mc12345678

Did to those that have subscribed to this thread... Was just going to advise about that, but see to some extent that it has been resolved. Still would recommend making the appropriate changes.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

24 Jun 2015, 4:06 AM
#15
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Post #15 by lruskauff

RodG:

If your 'site' consists of Zencart and nothing else, and the site resides in
/public_html/shop/ then any other files in the /public_html/ folder can be deleted.

HOWEVER, do yourself a favour and don't just go head first into deleting everything. In fact I suggest you delete nothing. Either create an 'archive' of the files first, or make a local backup of them. Then and only then should you consider deleting anything.
Yes, I've been renaming things with a .del or .old very slowly to see if there is any effect. And my blog and test folder reside there too. Along with some random html.

Back 'em up, then delete from the server. Check that the site is fully functional, then move (don't copy) all of the files out of /public_html/shop/ into /public_html/

Edit the config files to match the new location. Check that all is OK.

The reason I say move rather than copy, is because if you make a copy and don't get the configure file changes 100% correct you could end up with a site that appears to be fully functional, but is in fact pulling some data from the relocated files, and some data from the /shop/ folder. This can be a bit of a nightmare to both identify and resolve. In contrast, if you move the files the /shop/ folder will be empty, so now if you don't get the config files 100% correct the store simply won't function - But at least you'll know where to look for a solution - The config files.
That makes sense, thank you. But I may leave them in the folder and change the domain pointer as mc12345678 suggested. I would like it though that I didn't have to share the htaccess file. Is that file always in public_html?

Are you using the blog? If not, archive/backup the folder and delete it. If you are using it, leave it where it is.
Trying to.

It is bad practice to keep backup files in any 'publicly accessible' folder, that includes the /public_html/ folder and all of its sub folders.
Yes, I know. They are kindof my quick backup. I also have a copy on my pc.

I've no desire to confuse you, but directories/folders and domains/subdomains are entirely different things that have no direct relationship with each other.

domains/subdomains relate to the URL/URI that people need to use to access your site.
directories/folders relate to the physical location of the files on the server.

If you take a good look at the ZenCart configuration files you'll note that some 'defines' read like "DIR_FS_" and others are like "DIR_WS_"
These denote the 'File System' (where the files reside on the server) and the 'Web Server" (The URL/URI that people need to use to access the site) respectively.
A big thank you for that one, I sure it saved some BIG confusion down the road for me. I realized that they were two different things but I thought that they had the same structure. Well I did until I installed CEON URI, which made me realize something was logical in my brain, I just hadn't put the two together yet.

Although not strictly true, a web server will only function with files placed in the /public_html/ folder and its subfolder. On some systems this folder will be called /www/, /docroot/ and even \inetpub\
The exact name depends on what the server itself, and how the server admin has configured things. For the majority of people this can't be changed. Folders that reside above these defined folders are inaccessible to the webserver itself. This is a security measure to prevent people accessing the critical system files via a web browser.
[\quote]
Funny, I just quized my host on what all those folders were above my public_html directory and what they are for. Since I can access many of them, I figured I should know.

Thank you all for the many explanations.
Lin
Cheers
RodG

24 Jun 2015, 4:20 AM
#16
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #16 by mc12345678

Unless I'm missing something, the suggested code from your host looks like it forces the uri to show the store as being in a subdirectory which is exactly what is desired to not be presented.

I say this because I entered that into an .htaccess file tester and when entering domain-name.com it results in a uri of domain-name.com/folder

Like said I may be mistaken, but doesn't look like they are offering the solution we were discussing. Instead it is all back to having it all hosted in the file path one up above from the current file path.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

24 Jun 2015, 4:26 AM
#17
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #17 by mc12345678

.Htaccess file is considered a hidden file. As far as ZC is concerned, there is no need for a .htaccess file in the store's root. It is because other things require the rewrite offered by the .htaccess.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

24 Jun 2015, 4:56 AM
#18
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Post #18 by lruskauff

mc12345678:

Unless I'm missing something, the suggested code from your host looks like it forces the uri to show the store as being in a subdirectory which is exactly what is desired to not be presented.
bummer. You are prob right cause I just checked my blog and it adds the /blog too instead of just blog.thestitchsanctuary.com/

I say this because I entered that into an .htaccess file tester and when entering domain-name.com it results in a uri of domain-name.com/folder

Like said I may be mistaken, but doesn't look like they are offering the solution we were discussing. Instead it is all back to having it all hosted in the file path one up above from the current file path.
Thank you for doing that extra step. I'm asking them again. They aren't that wordy but they do answer quickly.

So .htacceess file, is it always in public_html directory (or whatever the host calls that directory)? So even if I moved my site down 12 levels, I would still do my rewrites here?

Do we ever use them elsewhere?

24 Jun 2015, 5:28 AM
#19
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Post #19 by rodg

lruskauff:

Ok, I went to my CPANEL and there is a "script" or "button" that I press and fill in the blanks for where I want my subdomain and blog to point. So I actually don't see what goes on behind the scenes. But I asked them (hosts) and they said I could do it by putting the following in my htaccess file.

Hmmmm... there's a bit of a confusion/contradiction going on here.

First up, exactly what is the 'script' or 'button' that you are referring to.

I'm assuming it is one of
Subdomains
Addon domains
Parked domains
or Redirects.

These each have their own purpose, and if you are referring to the subdomain one this is a setting that directly controls the server. This is the 'document root' setting.
There are no redirects taking place (under normal circumstances), and nothing gets added to the .htaccess file.

Your host is misleading you (or you are misleading them).

lruskauff:

The code is:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain-name.com$
RewriteCond %{REQUEST_URI} !folder/
RewriteRule (.*) /folder/$1 [L]


This is code that performs a redirect.  Redirects have their uses, but should be avoided wherever possible.  
(It is at this point that DivaVocals is going to step in and tell me how wrong I am) <SIGH>  

> **lruskauff:**
>
> I will assume that I would put it at the top before all other rewrites

Personally, I'd never make such an assumption.  One of the biggest headaches and drawbacks of URL rewrites is getting the *order* of the rules correct and this order depends on your specific needs and requirements.  
The best way to get it right is to not use the rewrites or redirects at all,  they are only needed in *specific* circumstances, and as far as I can tell, you aren't up to the stage where these 'specific circumstances' would apply.    

> **lruskauff:**
>
> but will it interfer with my Ceon URI Mapping rewrite rules as they stand?

I'm not going to say Yes, and I'm not going to say No.   I will say that they *could*.  The fact is looking at the rewrites that you have supplied here NOT ONE OF THEM IS REQUIRED.   

They are all 'Fixes' for 'problems' that wouldn't exist IF the documentRoot and DNS have been configured correctly in the first place.  

Trouble is. many people (Hi DivaVocals) just *love* URL rewrites and redirects, and tend to use this 'tool' to 'fix' every problem rather than doing it the right way in the first place.    The rewrite 'solutions' do tend to work, but what a mess they are to create, and it gets worse if/when you come across a situation where a rewrite is actually the correct tool for the job.   
  
> **lruskauff:**
>
> I don't think I would want the /shop/ rewrites but not sure how to format the one that just says /shop/ .  Would it be just "/" (no quotes, first rewrite cond).  Or can I just rre-run the ceon configuration script again.

You're not even using CEON for what it was designed for in the 1st place.  Get rid of it.   Simplify, simplify, simplify.    Don't rewrite anything that doesn't need rewriting.  

Seriously,  get rid of them all.  Set the documentRoot to where the files actually reside and your as good as done.  

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

24 Jun 2015, 5:40 AM
#20
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Post #20 by rodg

lruskauff:

bummer. You are prob right cause I just checked my blog and it adds the /blog too instead of just blog.thestitchsanctuary.com/

DocumentRoot isn't set to the correct folder. A rewrite has been added to 'correct' this. A better solution would be to correclty set the documentroot for the blog subdomain.

lruskauff:

So .htacceess file, is it always in public_html directory (or whatever the host calls that directory)? So even if I moved my site down 12 levels, I would still do my rewrites here?

Do we ever use them elsewhere?

The .htaccess file(s) can be placed in any folder that the webserver uses. These files are/were traditionally created and used for (Guess what?) To control who can access the files/folders in which they reside.

The ability to use these same file(s) for redriects and rewrites were a later addition (saved having to create another 'control' file for this purpose), so although rewrites and redirects could be placed in these files in the subfolders, they are generally only used in the documentRoot folder(s) rather than any of their subfolders.
That said, it isn't uncommon to have a single redirect in the .htaccess file(s) of subfolders that people shouldn't have access too.. This redirect takes the user back to the store front (or perhaps the login page).

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.