Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Oscommerce for dynamic virtual webhosts


Guest

Recommended Posts

I'm making a oscommerce with a config file that always works.

 

  define('HTTP_SERVER', '');
 define('HTTP_CATALOG_SERVER', '');
 define('HTTPS_CATALOG_SERVER', '');
 define('ENABLE_SSL_CATALOG', 'false');
 define('DIR_FS_DOCUMENT_ROOT', '/var/www/oscommerce/');
 define('DIR_WS_ADMIN', '/admin/');
 define('DIR_FS_ADMIN', '/var/www/oscommerce/admin/');
 define('DIR_WS_CATALOG', '/oscommerce/');
 define('DIR_FS_CATALOG', '/var/www/oscommerce/');
 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/');

 

So as you can see the define('HTTP_SERVER', ''); is empty

This works fine in FireFox but not with IE7.

So i started searching and trying

some people told me to do this

define('HTTP_SERVER', strtolower($_SERVER["HTTP_HOST"] ));

But this doesn't work either

 

in firefox my links become

http://<IP>/oscommerce/<ip>shopping_cart.php?osCsid=b986c0b73dc80f23a52196200f634bd1'>http://<IP>/oscommerce/<ip>shopping_cart.php?osCsid=b986c0b73dc80f23a52196200f634bd1

 

in IE

http://<IP>/<IP>account.php?osCsid=c5b0c86747f4128fca9a96aa7373ec97

 

but it should be

http://<IP>/oscommerce/

 

 

can someone help me on this?

Link to comment
Share on other sites

Both of these worked for me:

 

define('HTTP_SERVER', strtolower('http://' . $_SERVER['HTTP_HOST'] ));

define('HTTP_SERVER', strtolower('http://' . $_SERVER['SERVER_NAME'] ));

Your mileage may vary....

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Both of these worked for me:

 

define('HTTP_SERVER', strtolower('http://' . $_SERVER['HTTP_HOST'] ));

define('HTTP_SERVER', strtolower('http://' . $_SERVER['SERVER_NAME'] ));

Your mileage may vary....

:blush:

Almost :)

 

Thx already for this info.

 

The site acts already the same in IE and FF so I'm getting closer.

 

the only thing he does know is

http://<ip>account.php/?osCsid=45beef5a782bc8f6356754a269ca777d

instead of

http://<ip>/account.php/?osCsid=45beef5a782bc8f6356754a269ca777d

Link to comment
Share on other sites

If that was a request for more help, you'll need to be more explicit.

 

The lines look identical to me...

:huh:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

If that was a request for more help, you'll need to be more explicit.

 

The lines look identical to me...

:huh:

 

Yes it was :P

 

well have good look

 

http://<ip>account.php/?osCsid=45beef5a782bc8f6356754a269ca777d

instead of

http://<ip>/account.php?osCsid=45beef5a782bc8f6356754a269ca777d

 

You see that the slash that should behind the ip of the server is behind the php file

so this http://<ip>account.php/?osCsid=45beef5a782bc8f6356754a269ca777d is wrong

 

This it should be http://<ip>/account.php?osCsid=45beef5a782bc8f6356754a269ca777d

Link to comment
Share on other sites

My bad!!!

:blush:

 

(Note to self: Schedule appointment to get eyes checked...)

 

Check in the <head> section of your catalog account.php

 

Does it have a line like this:

 

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

:unsure:

 

If so, the link should be (symbolically speaking):

 

HTTP_SERVER:/oscommerce/account.php

 

HTTP_SERVER+DIR_WS_CATALOG+script_file_name

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

My bad!!!

:blush:

 

(Note to self: Schedule appointment to get eyes checked...)

 

Check in the <head> section of your catalog account.php

 

Does it have a line like this:

 

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

:unsure:

 

If so, the link should be (symbolically speaking):

 

HTTP_SERVER:/oscommerce/account.php

 

HTTP_SERVER+DIR_WS_CATALOG+script_file_name

 

 

Np :)

it's quite confusing

 

Yes it has that line, but i'm wondering, it's not only for account.php i have this, i have this for every link in my oscommerce.

does this means I need to change every file in my OSC?

 

So to make sure i understand you right I need to make the file something like this (I moved my OSC from the folder oscommerce to the root www dir to make it a bit easier)

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER:/) . DIR_WS_CATALOG; ?>">

Link to comment
Share on other sites

If you moved it to the root, this line:

 

define('DIR_WS_CATALOG', '/oscommerce/');

needs to be:

 

define('DIR_WS_CATALOG', '/');

You do realize that in the end, this will never work, a "config file that always works".

 

If someone is using shared SSL, the HTTPS link becomes something out of the blue like:

 

  define('HTTPS_SERVER', 'https://domain.c4.ixwebhosting.com');

Or something even more erratic and unpredictable.

 

And no you shouldn't "need to change every file in my OSC?"

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

If you moved it to the root, this line:

 

define('DIR_WS_CATALOG', '/oscommerce/');

needs to be:

 

define('DIR_WS_CATALOG', '/');

You do realize that in the end, this will never work, a "config file that always works".

 

If someone is using shared SSL, the HTTPS link becomes something out of the blue like:

 

  define('HTTPS_SERVER', 'https://domain.c4.ixwebhosting.com');

Or something even more erratic and unpredictable.

 

And no you shouldn't "need to change every file in my OSC?"

I changed that catalog stuff already :)

 

SSL I don't care, if we want to use SSL we still can modify this in the config file

Why i want a setup like this?

This is for virtual machines so we can have certain OSC within minits up and running (we have done some mods to OSC so it can talk to a certain agent on that virtual machine, ...)

 

I created this on my local laptop (localhost) but now I want to make a setup that it 'works' out of the box

With Joomla and so on this was no problem but OSC seems to be impossible

Link to comment
Share on other sites

I changed that catalog stuff already :)

 

SSL I don't care, if we want to use SSL we still can modify this in the config file

Why i want a setup like this?

This is for virtual machines so we can have certain OSC within minits up and running (we have done some mods to OSC so it can talk to a certain agent on that virtual machine, ...)

 

I created this on my local laptop (localhost) but now I want to make a setup that it 'works' out of the box

With Joomla and so on this was no problem but OSC seems to be impossible

ok my bad

 

I had this define('DIR_WS_HTTP_CATALOG', '');

instead of

define('DIR_WS_HTTP_CATALOG', '/');

in the configure.php

 

works very good know.

thx for all the help!!!!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...