Latest News: (loading..)

Archived

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

nat8100

move to root or redirect?

18 posts in this topic

Hi everyone?

 

I know this question has been asked before? and I have read all the posts and documentation I can find? but would really like some advice if anyone can help.

 

I have (stupidly) installed my site in the /catalog directory, clearly without thinking it through properly. Ideally I want to have it in the root, but am happy to have any solution that works, does not involve an entrance page and does not affect search engine rankings.

 

My site is still in development and not live so down time etc. is not a problem.

 

My hosting is with 1and1. They offer a re-direct service in the admin control panel. Basicly you can set the domain to have its ?home? directory as a sub-directory, i.e. /catalog? and doing this makes the site act as if it is in the root of the domain. So in theory the configure files should be changed to reflect this, i.e. take out all the /catalog references. I tried this, and the admin worked fine, but the site images were all broken and all the links were also broken (still showing the /catalog path). Has anyone used 1and1 to do this? I also have STS Plus installed ? I don?t think this should affect it but thought I?d mention it.

 

The other form of re-direct you can do is a full path, but this really isn?t an option as I think 1and1 uses frames to do this.

 

Before I try moving my site again (I have moved it back for now) I would like to know if there is a way I can redirect ? However I have content in my root and other domains using the root, so I need it to be for just this one domain ? if that makes sense.

 

The only other thought I had was to replicate the look of my home page in html, and then all the links will be directed to my /catalog directory.

 

Thanks in advance if anyone can give me any advice or suggestions.

Share this post


Link to post
Share on other sites

It is very easy to move a store from the catalog directory to the root. It is much better to move the store than to redirect.

 

The first step is to move, or copy, your entire catalog directory to the root. This includes all the files and directories. Then, make the necessary changes to the include/configure.php and admin/include/configure.php files and you are done. The changes to those two files are simply change where you define your catalog. it probably says '/catalog/' now, change it to '/'. That should be it, unless you hardcoded any links or files in your store. You will need to fix them individually.

 

This whole operation should take you less than 10 minutes, and 8 of it will be the time it takes for your FTP to pull down the files and push them back up in a different place. Because you now have two copies of your store, one in the root and one in the catalog directory, change the name of the catalog directory to test or development and use it to test modifications. If you change the directory name you will need to change the configure files. If you don't want the test store, delete the catalog directory and you are good to go.

Share this post


Link to post
Share on other sites
It is very easy to move a store from the catalog directory to the root. It is much better to move the store than to redirect.

 

The first step is to move, or copy, your entire catalog directory to the root. This includes all the files and directories. Then, make the necessary changes to the include/configure.php and admin/include/configure.php files and you are done. The changes to those two files are simply change where you define your catalog. it probably says '/catalog/' now, change it to '/'. That should be it, unless you hardcoded any links or files in your store. You will need to fix them individually.

 

This whole operation should take you less than 10 minutes, and 8 of it will be the time it takes for your FTP to pull down the files and push them back up in a different place. Because you now have two copies of your store, one in the root and one in the catalog directory, change the name of the catalog directory to test or development and use it to test modifications. If you change the directory name you will need to change the configure files. If you don't want the test store, delete the catalog directory and you are good to go.

 

Hi,

 

I did the following, but I get a "Red Hat Enterprise Linux Test Page" when I go to my website domain. I previously had it redirecting to the /catalog. Do I need an index.php file in my root?

 

Thanks!

Share this post


Link to post
Share on other sites

you get that because you have an index.htm in your root directory. Take this out, your site will show up.

Share this post


Link to post
Share on other sites
you get that because you have an index.htm in your root directory. Take this out, your site will show up.

 

Hi Tony,

 

I did this but all my links are not valid, although my page is showing up. Please help if you can. Thanks!

Share this post


Link to post
Share on other sites

If the links are not valid, then you need to take a closer look at includes/configure.php. When you hover over a link, the url should appear at the bottom of our browser. That should tell you were you might be going wrong.

Share this post


Link to post
Share on other sites
If the links are not valid, then you need to take a closer look at includes/configure.php. When you hover over a link, the url should appear at the bottom of our browser. That should tell you were you might be going wrong.

 

Thanks for the tip. I will take a look at this later. I have the SEO URL contribution installed, so does this make a difference?

Share this post


Link to post
Share on other sites

You should notice the problem. If it is a configure define statement, then you should see it as an extra / or the wrong directory - something like that. What do you get when you go directly to your index.php page?

 

http://www.yourdomain.com/index.php

Share this post


Link to post
Share on other sites
It is very easy to move a store from the catalog directory to the root. It is much better to move the store than to redirect.

 

The first step is to move, or copy, your entire catalog directory to the root. This includes all the files and directories. Then, make the necessary changes to the include/configure.php and admin/include/configure.php files and you are done. The changes to those two files are simply change where you define your catalog. it probably says '/catalog/' now, change it to '/'. That should be it, unless you hardcoded any links or files in your store. You will need to fix them individually.

 

This whole operation should take you less than 10 minutes, and 8 of it will be the time it takes for your FTP to pull down the files and push them back up in a different place. Because you now have two copies of your store, one in the root and one in the catalog directory, change the name of the catalog directory to test or development and use it to test modifications. If you change the directory name you will need to change the configure files. If you don't want the test store, delete the catalog directory and you are good to go.

 

Thanks for the advice.. I thought it was a fairly easy job too but still managed to mess it up! Will give it another go though.. :)

Share this post


Link to post
Share on other sites

Have tried it again and got a bit further... got all the links working - I think last time my configure file wasn't actually overwriting although it looked that way because I had the CHMOD set to read only... I changed to to write and uploaded my changed file and it seemed to work. Has broken STS again in admin though... as in I can't now install the module, don't know if perhaps it is referencing the wrong place.. but I don't think any of the links are hard coded... so if anyone has had this problem please let me know.. i'll just have a look back through the STS code.

 

Thanks

Share this post


Link to post
Share on other sites

Further to my last reply... it seems it is not an STS issue.. I've clearly messed up the admin configure file somewhere.. Basically it is all of my 'modules', so STS, shipping, payment etc. They are all working fine on the catalog side of things, but in admin they say they are uninstalled, and if you click to install them, the page just refreshes with no change. Please can someone help - really not sure where to start on this one! I have looked through by configure file and can't find any references to /catalog left.

 

Also... in admin.. the tools>backups is not working. It says the backups folder is not defined in configure.php

 

and then the final problem (i hope) is that when I click on customers it has this error:

 

Parse error: parse error, unexpected T_CASE in /homepages/4/d75936541/htdocs/catalog/admin/customers.php on line 194

 

It is still giving the /catalog dir, again not sure why - I'm hoping all these issues are down to the same thing?

Share this post


Link to post
Share on other sites
Anyone got any ideas? Please help! :)

 

Have modifided and uploaded both configure.php files?

 

One in catalog/includes and one in catalog/admin/includes.

Share this post


Link to post
Share on other sites
Have modifided and uploaded both configure.php files?

 

One in catalog/includes and one in catalog/admin/includes.

 

Yes I have - don't know if I've missed something in the admin one:

 

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
 define('HTTP_SERVER', 'http://www.domainname.com'); // eg, http://localhost - should not be empty for productive servers
 define('HTTP_CATALOG_SERVER', 'http://www.domainname.com');
 define('HTTPS_CATALOG_SERVER', '');
 define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
 define('DIR_FS_DOCUMENT_ROOT', '/kunden/homepages/4/d75936541/htdocs/'); // where the pages are located on the server
 define('DIR_WS_ADMIN', '/admin/'); // absolute path required
 define('DIR_FS_ADMIN', '/kunden/homepages/4/d75936541/htdocs/admin/'); // absolute pate required
 define('DIR_WS_CATALOG', '/'); // absolute path required
 define('DIR_FS_CATALOG', '/kunden/homepages/4/d75936541/htdocs/'); // absolute path required
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
 define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
 define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
 define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
 define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
 define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

Share this post


Link to post
Share on other sites

Ok.. update! I have been readign the forums and found quite a few people have the problem with the modules not showing in admin.. but there doesn't seem to be any 1 solution - as ever i guess!

 

I have modified by admin configure file to look like this:

 

/   define('HTTP_SERVER', 'http://www.domainname.com'); // eg, http://localhost - should not be empty for productive servers
 define('HTTP_CATALOG_SERVER', 'http://www.domainname.com');
 define('HTTPS_CATALOG_SERVER', '');
 define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
 define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where the pages are located on the server
 define('DIR_WS_ADMIN', '/admin/'); // absolute path required
 define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN); // absolute pate required

 

This solves the backup tool problem - it is referencing catalog dir. even though it's not there, but it's working.

 

Now as for the modules, if I change:

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . '/includes/modules/');

to:

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . '/catalog/includes/modules/');

 

I get loads of errors in the modules pages, for example on the payment:

Warning: main(/kunden/homepages/4/d75936541/htdocs/includes/languages/english/modules/payment/authorizenet.php): failed to open stream: No such file or directory in /homepages/4/d75936541/htdocs/catalog/admin/modules.php on line 137

 

Warning: main(): Failed opening '/kunden/homepages/4/d75936541/htdocs/includes/languages/english/modules/payment/authorizenet.php' for inclusion (include_path='.:/usr/local/lib/php') in /homepages/4/d75936541/htdocs/catalog/admin/modules.php on line 137

MODULE_PAYMENT_AUTHORIZENET_TEXT_TITLE

 

etc. for each payment module...

 

HOWEVER at the bottom of the errors I have the modules (in some form) and can actually click on them and install and edit and they work in the catalog side. No idea why, as the directory isn't lcoated in /catalog???

 

I guess this is progress of sorts? At least I can use the modules!

 

As for the customers.php error, I don't think that's to do with the same problem, and something I missed when installing another contrib.

Share this post


Link to post
Share on other sites

Line 137 of admin/modules.php

include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/' . $module_type . '/' . $file);

Share this post


Link to post
Share on other sites

All sorted now! Again, just in case anyone has the same problem - have changed:

 

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . '/includes/languages/');

 

to:

 

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . '/catalog/includes/languages/');

 

no idea why this works but it does!

Share this post


Link to post
Share on other sites

Sorry to revive an old thread, but I did not see a mention of this and since this comes up near the top of the search results (when I was looking for the answer), I thought I'd post my discovery here for everyone else's benefit.

 

one more file to check on is the .htaccess in your oscommerce install root directory, which would be the same as the web root directory, if you're moving the install there.

 

Make sure the following is true:

RewriteBase /

 

instead of

RewriteBase /oscommerce/catalog/

Share this post


Link to post
Share on other sites