PDA

View Full Version : Need help with osCommerce and/or .htaccess


Bernard
21-04-2005, 23:58/11:58PM
I'm experimenting with osCommerce right now and really fighting to get the basic functionality to work. I think I've narrowed down what's happening, but I'm not sure how to fix it.

I've got the following in my .htaccess file:Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^interplansystems.com
RewriteRule ^(.*)$ http://www.interplansystems.com/$1 [R=permanent,L]
ErrorDocument 404 http://www.interplansystems.com/404.html

For some reason, osCommerce insists on forming URIs for the forms using "http://interplan...." instead of "http://www.interplan...".

This does not appear to cause any problems until the forms try passing some parameters (like when a user tries to register or add something to a cart).

I've edited/checked the configure.php file and made sure that the first three defines use the www version of the URI. I can't see where it is specified anywhere else.

Ideas?

ArmenT
22-04-2005, 02:24/02:24AM
Looks like you munged the hostname when trying to install osCommerce and are trying to fix it:
1. Are you sure you've edited all the instances of configure.php file. There are at least 5 places where this file is present in the file system (not counting the default ones). You'll need to edit it in all these places.

2. Try adding a / in your rewrite rule:

RewriteRule ^/(.*)$ http://www.interplansystems.com/$1 [R=permanent,L]

Bernard
22-04-2005, 23:26/11:26PM
Awesome. Thanks Armen. The / did the trick.

I'm pretty sure that there is some setting I missed or the URIs would be formed correctly. Sigh...


[edit: well, with the / as indicated, the interplansystems.com is not redirected to www.interplansystems.com. Back to square one, but it looks like I might uninstall osCommerce anyway... I have another solution.]

ArmenT
23-04-2005, 15:35/03:35PM
I guess you could fix it by appending your original RewriteCond and RewriteRule below the new rules. However, if you have another solution, that's all good too