Jump to content

Archived

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

sackling

changing install root technique help

Recommended Posts

Hey everyone,

 

After having my oscommerce install for about 3 years in the public_html/catalog/ folder I want to move the whole thing to just the public_html/ root folder.

 

I believe the way to do this is to just copy all the files to the root and change both configuration files by removing all references to catalog/

 

My question then is (if that procedure is correct) what is the best way to test this switch before committing to it? I have a bunch of contributions installed as well I would like to be able to test that everything is working before I put it on my live site.

 

Any insight would be really helpful. Thanks so much.

Share this post


Link to post
Share on other sites

Personally I would not move, but instead place an .htaccess and rewrite the url:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/catalog/
RewriteRule ^(.*)/? /catalog/$1

et voila, your site if effectively moved to the root while all links used to /catalog/ will remain functioning, and thus alow you to test it out.

 

when this works, you can update your config file to match the new HTTP_SERVER and HTTPS_SERVER (the rest can stay the same, as the DIR_WS is not actually different).

 

If all is satifactory, you could rename catalog to something else (and update all files to match that change), make a new catalog folder, and in it make all old url's redirect to the same url without the /catalog part, this so search engine results will be updated to keep their google rankings etc. Keeping the catalog folder as is would not be a big issue either, as visitors comming from external sites would still get to see your shop, however the redirect is the proper way to go.

 

you could do that through htaccess aswell, for more tips about that see:

corz.org or google for .htaccess tips and tricks

 

 

 

One thing I would recommend not doing, that is simply deleting stuff and letting your 3 year old site return 404's when (old) pages are requested. That would kill your search engine results and rankings.

Share this post


Link to post
Share on other sites

That sounds really good. Thank you! Just to clarify how this is working exactly:

 

The .htaccess file code is making it so that every link that requests a url with /catalog in it will in fact just be linking to the root directory correct?

 

In doing so I will still need to change the config files HTTP_SERVER and HTTPS_SERVER by removing the /catalog lemme just show you how my code is now since I think it may be a little different then the norm in the config file:

 

// * DIR_WS_* = Webserver directories (virtual/URL)
 define('HTTP_SERVER', 'http://www.mysite.com'); // eg, http://localhost - should not be empty for productive servers
 define('HTTPS_SERVER', 'https://www.mysite.com/catalog/'); // eg, https://localhost - should not be empty for productive servers
 define('ENABLE_SSL', true); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', 'www.mysite.com');
 define('HTTPS_COOKIE_DOMAIN', 'https://www.mysite.com/catalog/');
 define('HTTP_COOKIE_PATH', '/catalog/');
 define('HTTPS_COOKIE_PATH', 'catalog/');
 define('DIR_WS_HTTP_CATALOG', '/catalog/');

 

So would I just remove the /catalog from the HTTPS_SERVER?

 

Next is where I get a little fuzzier as well.

make a new catalog folder, and in it make all old url's redirect to the same url without the /catalog part

 

Why would I be making a new catalog folder? With the goal being to move all the files to the root? I'm pretty sure I am misunderstanding this step.

Share this post


Link to post
Share on other sites

Hey everyone,

 

After having my oscommerce install for about 3 years in the public_html/catalog/ folder I want to move the whole thing to just the public_html/ root folder.

 

I believe the way to do this is to just copy all the files to the root and change both configuration files by removing all references to catalog/

 

My question then is (if that procedure is correct) what is the best way to test this switch before committing to it? I have a bunch of contributions installed as well I would like to be able to test that everything is working before I put it on my live site.

 

Any insight would be really helpful. Thanks so much.

If you really want to do the move then be sure and sign up for Webmaster tools at Google and Bing, at least. From there you will be able to tell the search engines that you moved and the search engine links will be updated almost instantaneously, and you will not lose rankings, etc.

 

After the move, be sure and put a RewriteRule in an .htaccess file to re-direct those with bookmarked links, and lesser known search engine links.

 

 

I'm thinking there really is no reason why you could not leave your present /catalog/ structure in place and load everything up into your root folder. Once you do that change the configure.php files in /%root%/includes/configure.php and /%root%/admin/includes/configure.php to reflect the new paths. Test it by going to www.yourdomain.com and see if you get your shop and can navigate properly.

 

At this point your shop should be able to be accessed by either www.yourdomain.com or www.yourdomain.com/catalog

 

Once you are satisfied it is working, then go to Google Webmaster tools (and any others) and change your address. Eventually you can simply delete the /catalog/ directory. I would still have the RewriteRules so that any bookmarked links will be handled.


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites
The .htaccess file code is making it so that every link that requests a url with /catalog in it will in fact just be linking to the root directory correct?
No, it takes every link that does not link to catalog/, and behind the scenes, makes it link to catalog, though not to be seen.

 

 

In doing so I will still need to change the config files HTTP_SERVER and HTTPS_SERVER by removing the /catalog
Not needed for testing, is needed to keep the visitor on the root, else each link shown would link to /catalog. Updating this will adjust the links generated by osc.

 

define('HTTP_SERVER', 'http://www.mysite.com'); // 
 define('HTTPS_SERVER', 'https://www.mysite.com/catalog/'); // needs to be adjusted too (drop the catalog for links without catalog in em)
 define('ENABLE_SSL', true); 
 define('HTTP_COOKIE_DOMAIN', 'www.mysite.com');
 define('HTTPS_COOKIE_DOMAIN', 'https://www.mysite.com/catalog/');
 define('HTTP_COOKIE_PATH', '/catalog/'); // --> / (drop catalog)
 define('HTTPS_COOKIE_PATH', 'catalog/'); // --> / (drop catalog)
 define('DIR_WS_HTTP_CATALOG', '/catalog/'); //keep this catalog, all links with DIR_WS should remain unaltered

 

 

 

 

Why would I be making a new catalog folder? With the goal being to move all the files to the root? I'm pretty sure I am misunderstanding this step.
You have a 3 year old website, search engines find you, generate trafic to your website.

Simply ignoring those is a mistake. From the past 3 years that they have been visiting you, they have records. These can be updated by you, to match their updated location. If you don't care about them, leave it be :)

Share this post


Link to post
Share on other sites
I'm thinking there really is no reason why you could not leave your present /catalog/ structure in place and load everything up into your root folder.
Can do though would leave duplicate content. Would also double the HD space required.

 

Perhaps it is the most simple way.

Share this post


Link to post
Share on other sites

Can do though would leave duplicate content. Would also double the HD space required.

 

Perhaps it is the most simple way.

Yeah, if it weren't for the images it wouldn't take up much space at all. Two or three months shouldn't hurt and once he is satisfied all is working he can delete the /catalog/ contents and just leave an .htaccess there for stray bookmarks and stuff.

 

I'll be curious if it actually works, lol.


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

×