Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Stumped by setup!


Karter

Recommended Posts

Posted

Hi everyone, sorry yet more newbie questions :'(

 

I needed to setup a shop for someone so I've download and installed 2.2 without issues, however my first time of using a Linux server so would appreciate a bit of advice please.

 

I printed out all 114 pages of the manual and followed the instructions, and I'm pleased to say that all went well, I now have a 'shop' at http://www.mydomain.co.uk/catalog/'>http://www.mydomain.co.uk/catalog/

But nothing at http://www.mydomain.co.uk

 

I have since seen that I could have placed the shop in the root of the server if I had wanted to http://www.oscommerce.com/forums/topic/358503-site-not-loading/ refers, I don't really want to move the site up a level for the reasons given in that post, so my questions/queries are this.

 

I think I have two options here, one would be to rewrite the .htaccess file, or two would be I guess to create a default.php page in the root of the server as either a greetings page or straight redirect page (I've tried looking to see if I can put in a permanent redirect and can't see the option)

 

With regard to the .htaccess file, OK so I've taken a look at it, and being perfectly honest, I've not a clue what to write where in it, can someone give me a pointer on that please.

If I decided to create a default.php page for the root how would I go about ensuring that it takes all the formating information for the rest of the site please should I want it to look like the rest of the site.

 

Your thoughts as to which of the two above options would be best would also be appreciated.

 

Sorry, one more thing, I've done as suggested and renamed the /install/ folder as /install.old/ will be that good enough to 'secure it' or should I delete it completely?

 

Thanks, and sorry for the length of my first post here.

Nick

Posted

...

 

I have since seen that I could have placed the shop in the root of the server if I had wanted to http://www.oscommerce.com/forums/topic/358503-site-not-loading/ refers, I don't really want to move the site up a level for the reasons given in that post, ...

You got spooked by that post, huh? Don't be. It's really not that bad. There's nothing wrong installing it to the root.

 

If you haven't done much to your site, go through the install again. Copy the contents of the catalog folder to root and do another fresh install ... www.mydomain.co.uk/install

 

There's no need to redirect when installed to root.

 

If you don't want to go through the install, copy the contents of the catalog folder to root and make these changes to your configure.php files.

 

includes/configure.php

 define('HTTP_SERVER', 'http://www.mydomain.co.uk');
 define('HTTPS_SERVER', '');
 define('ENABLE_SSL', 'false');

 define('HTTP_COOKIE_DOMAIN', '.www.mydomain.co.uk);
 define('HTTPS_COOKIE_DOMAIN', '');

 define('HTTP_COOKIE_PATH', '/');
 define('HTTPS_COOKIE_PATH', '/');
 define('DIR_WS_HTTP_CATALOG', '/');
 define('DIR_WS_HTTPS_CATALOG', '/');

 define('DIR_FS_CATALOG', $_SERVER['DOCUMENT_ROOT'] . '/');

admin/includes/configure.php

 define('HTTP_SERVER', 'http://www.mydomain.co.uk');
 define('HTTP_CATALOG_SERVER', 'http://www.mydomain.co.uk');
 define('HTTPS_CATALOG_SERVER', '');
 define('ENABLE_SSL_CATALOG', 'false'); 
 define('DIR_FS_DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT'] . '/'); 
 define('DIR_WS_ADMIN', '/admin/');
 define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN);
 define('DIR_WS_CATALOG', '/');
 define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);

 

If you still insist, maybe >>this will help.

 

I think you're making this more difficult than it should.

Posted

Hi Bryce, many thanks for your reply, very helpful.

 

Well yes I guess I did get a bit spooked by the post, but as said, first time using OSC and first time using a Linux server, so I thought I was doing the right thing :blush:

 

Unfortunately I've done plenty to the site, it is fully populated with products and images now, just all the blah blah stuff to do now.

Given that I've done so much to the site, looks like I'll try copying the contents of the catalog folder to the root and rewrite the configure.php files route, once I've done that, can I then delete the catalog folder?

 

Many thanks for the code for the configuration.php rewrite, and the link to the tut on .htaccess, much appreciated.

 

Yes quite possibly I'm making this more difficult than it needs to be, but as said, I just followed the instructions for initial setup and configuration, so I can hardly be blamed for that.

 

Thanks

Nick

Posted

My aplologies, slight correction ... ooops :blush:

includes/configure.php

 define('HTTP_COOKIE_DOMAIN', '.www.mydomain.co.uk'); 

 

... once I've done that, can I then delete the catalog folder?
Yes.

 

****Always backup your files when making changes. If something goes wrong, you can always revert to a working copy.****

 

Another important thing to do >>Securing your Site

Posted

If you haven't yet moved the cart to the root, I would strongly suggest leaving it in catalog. It's easy to redirect using .htaccess or an /index.html page with a redirect meta tag. The advantage to putting osC in its own directory (folder) is that it's kept safely out of any other application's way (and vice-versa), making it easy to later expand your site to add other applications (forum, blog, gallery, etc.). Read my sig > FAQs > "Put an application in the site root, or a Subdirectory?" and "domain/ versus domain/forum".

Posted

My aplologies, slight correction ... ooops :blush:

 

Yes.

 

****Always backup your files when making changes. If something goes wrong, you can always revert to a working copy.****

 

Hi Bryce, many thanks for the corrected code, I was planning on doing that today, so no harm done :)

Thanks also for confirming that I could delete the catalog folder afterwards if I wanted to.

Oh yes, backups by the dozen, I'm treading very cautiously with this.

 

Nick

Posted

If you haven't yet moved the cart to the root, I would strongly suggest leaving it in catalog. It's easy to redirect using .htaccess or an /index.html page with a redirect meta tag. The advantage to putting osC in its own directory (folder) is that it's kept safely out of any other application's way (and vice-versa), making it easy to later expand your site to add other applications (forum, blog, gallery, etc.). Read my sig > FAQs > "Put an application in the site root, or a Subdirectory?" and "domain/ versus domain/forum".

Hi Phil, no I ran out of time yesterday to move the site, that was planned for this morning, after I'd popped into here, but I would still prefer not to move the site for precisely the reasons you give.

I have to say I'd not thought of a meta tag redirect on the index.html page, by my own admission I'm not the world best coder, but that resolves the issue perfectly, you're a star mate, that is the quickest, easiest and simplest way there could be, huge thanks :D

 

A very quick rewrite of index.html this morning and I stuck this into the head section of the index.html on the root:

<meta http-equiv="refresh" content="1;url=http://mydomain.co.uk/catalog/">

Works perfectly :)

 

Thanks also to the link for your FAQ's if I want to use the .htaccess rewrite instead I would need this right?

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/catalog [NC]

RewriteRule ^(.*)$ http://mydomain/catalog/$1

 

Does it matter where it is placed in the .htaccess file?

 

Nick

Posted

That looks like it should work, and anywhere in .htaccess. Only you know what other URL redirection/rewriting you do in .htaccess, and whether this rewrite will interfere with others.

 

One suggestion: If you have http://... in the RewriteRule, I think it sends a "302" code by default. This means that your browser gets back a 302 status and the new URL, and it has to send another request. If you just specify /catalog/$1, I think it uses a 200 code and does it all on the server in one operation. You could experiment with the Firefox browser + "Live HTTP Headers" plug-in to confirm that it actually works that way.

Posted

That's great, thanks Phil :)

 

Think I'll leave the meta tag redirect as is for now.

 

Site is now up and running, although I still have work to do on it, T&Cs etc, it's a bit vanilla with just some colour changes etc, but I only had a very short while to get it up and running, comments both good and bad for my first attempt welcome please folks, you can find it here http://www.britishbeercompany.es

 

BTW, I want to remove the footer banner, I guess that is simply deleting the banner in the banner manager of admin?

 

Nick

Posted

BTW, I want to remove the footer banner, I guess that is simply deleting the banner in the banner manager of admin?

D'oh, how the hell did I manage to miss the option to make the thing inactive in the admin :-" :blush:

  • 4 weeks later...
Posted

Think I'll leave the meta tag redirect as is for now.

That method should never be used. It is a sure way to not get your site listed in the search engines, at least not well. Using an .htaccess redirect is the correct way.

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

Archived

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

×
×
  • Create New...