Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

make a page at root directory


Foolishman

Recommended Posts

Dan, I think the answer is independent of the osC version, although it is good to train them to give version information.

If you installed into /catalog or /shop (the recommended ways) and not into / (bad practice), you will need something to skip visitors from / to /catalog until you install other stuff on your site and want a "landing page" at /. Assuming you are on an "Apache" server, or some other one configured to obey the .htaccess file, you would put this in your /.htaccess file:

RewriteEngine On
	RewriteCond  %{REQUEST_URI}  !^/catalog  [NC]
	RewriteRule  ^(.*)$  /catalog/$1  [L]

If you have no idea what you're doing, consult with your hosting tech support on how to implement this. Note that the status code is NOT set... the idea is to make this rewrite invisible to the visitor. They type in your domain URL, and magically find themselves in /catalog.

Some people will tell you to move your shop to root (/). DON'T do that. It belongs in /catalog (or /shop) for a number of reasons. Rewrite the incoming URL from / to /catalog. If you ever install other applications, with a landing page, remove this rewrite. Also note that some control panels will hide your .htaccess file, so make sure it's displayed in your file manager listing.

Link to comment
Share on other sites

Foolishman - I disagree with Phil's suggestion to place the shop in a sub-directory but it sounds like that is already the case for your site. If I am understanding your question correctly, you have the shop in the catalog directory and the root directory doesn't have an entrance page.

If that is correct, you need to decide is there is a reason for an entrance page. That is only needed if you are going to have a link to the catalog directory along with some other details. If you don't need to display other details, then you should just add redirect code to force all connections to the catalog directory. In most cases, the use of such an entrance page is not a good idea.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

7 hours ago, justcatering said:

Need help please follow these instructions.

 

Phil, I have been called a lot worse!:biggrin: ( Sorry Dan ) but even I am a bit confused! Why would you never recomend installing in root ? I have never done anything other than that unless I wanted a test site on the same domain in which case I install in sub directory of root.

 

Link to comment
Share on other sites

2 hours ago, justcatering said:

Phil, I have been called a lot worse!:biggrin: ( Sorry Dan ) but even I am a bit confused! Why would you never recomend installing in root ? I have never done anything other than that unless I wanted a test site on the same domain in which case I install in sub directory of root.

If you are absolutely certain that you will never, ever, want to install something else besides osC on your site, go ahead and install in root. If there's any chance that you might want to install another application, put all applications in their own subdirectory. This keeps them cleanly separated from each other, so they won't step on each others' toes and can be removed or replaced without fear of breaking something else on your site. The root directory can be kept fairly clean and uncluttered, with the only .htaccess entries being those which should apply to the whole site. Application-specific rewrites, etc. should go in the subdirectory's .htaccess. If you insist on installing, say, osC into root, all later applications (e.g., a Wordpress blog) will have to pass through /.htaccess first, which often leads to major headaches as osC does things which can interfere with WP (or vice-versa). It's just far easier to understand your .htaccess files when they're separated like this, rather than trying to bypass or back out osC changes when the target is WP. Finally, you won't be faced with the difficult decision as to whether to move an already up-and-running application to a subdirectory, with all the disturbance this brings to existing customer bookmarks and search engine entries.

This is why I always come out strongly against installing osC (or any other application) into the root.

Link to comment
Share on other sites

13 hours ago, MrPhil said:

If you are absolutely certain that you will never, ever, want to install something else besides osC on your site, go ahead and install in root. If there's any chance that you might want to install another application, put all applications in their own subdirectory. This keeps them cleanly separated from each other, so they won't step on each others' toes and can be removed or replaced without fear of breaking something else on your site. The root directory can be kept fairly clean and uncluttered, with the only .htaccess entries being those which should apply to the whole site. Application-specific rewrites, etc. should go in the subdirectory's .htaccess. If you insist on installing, say, osC into root, all later applications (e.g., a Wordpress blog) will have to pass through /.htaccess first, which often leads to major headaches as osC does things which can interfere with WP (or vice-versa). It's just far easier to understand your .htaccess files when they're separated like this, rather than trying to bypass or back out osC changes when the target is WP. Finally, you won't be faced with the difficult decision as to whether to move an already up-and-running application to a subdirectory, with all the disturbance this brings to existing customer bookmarks and search engine entries.

This is why I always come out strongly against installing osC (or any other application) into the root.

Not sure I agree with you Phil, Approaching it from a business perspective, I would always advise any new store to concentrate on the store first. Make it the main focus and do not have other distractions like blogs and other “padding” on the domain. Anything else is secondary to your e store.

Hence I always install in root and have always been advised to do so. I have had WP blogs on the same domain in the past and always had them in a sub directory while having 2.2a in root.

Interestingly the general advise for WP is to also install in root unless you intend to have more than one install on same domain.

So I suppose its do what every you feel comfortable doing, no hard and fast wrongs or rights.

 

Link to comment
Share on other sites

12 minutes ago, wHiTeHaT said:

I do not need to elaborate on that.
You started a discussion with someone giving advice to the OP.
I just point out these reasons.
There can be many situations that a store/shop is an extension of the initial start-up.
A online-store does not need to be the primary business-model.

If i would be a hair-cutter, my primary business-model is to cut hair.
So i could use a online-schedule system.
But i also sell hair-product in my barber-shop.
So yes, would be nice if i could also sell these online.

My local barber has for instance his own branded hair-gel.
And he sell it on his site.
 

Sure thanks for the insightful clarification of your point of view its very helpful.  :thumbsup::biggrin:

 

Link to comment
Share on other sites

3 hours ago, justcatering said:

I would always advise any new store to concentrate on the store first. Make it the main focus and do not have other distractions like blogs and other “padding” on the domain. Anything else is secondary to your e store.

Well, as I said before, if you're sure your store is going to be the only application on the site, go ahead and put it in the root. Otherwise, make any future site expansion simpler and cleaner by putting it in its own subdirectory (/catalog), so other applications can be installed without getting tangled up with each other. I've seen too many sites where owners don't remember what stuff in root belongs to what application, or one app's .htaccess overwrites another's, or their osC access passes through WP's .htaccess first and gets messed up, or they're forced to move an existing app (breaking bookmarks and search engine entries), etc. I like to keep them cleanly separated from the very beginning. YMMV.

Link to comment
Share on other sites

:thumbsup:

I think we are both saying the same thing, my only issue was in your definitive “DON'T “ as the discussion has shown not everyone has that view.

I use the principal install your main function in root, anything else can be added as sub if and when at later date ( if ever ). Your saying no do it all in sub from the start.

I don't think we are that far apart.:biggrin:

 

Link to comment
Share on other sites

My position is that having some application in the root, and then later adding other applications to subdirectories, is asking for trouble. Remember, the later apps have to go through the root .htaccess, which will be tailored for the first app, and that will often cause problems for the later (lower level) apps. If you're absolutely confident that you will never install a second app, go ahead and put the first in the root, if you so desire. Also keep in mind that if, say, osC is your root app; it may be difficult to later insert a "landing page" to direct visitors to your domain root to your various apps, unless you want to bend osC's code to include links to other apps. With enough work and knowledge, this can all probably be done, but it's going to be beyond the skills of your typical store owner. I prefer to keep everything clean and simple, but not everyone will agree with me.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...