Perhaps someone can let me know what I am missing.
This site was recently upgraded to 1.3.9h. It has the zen cart install in a directory /shop/ . This is for historical reasons and can't really be changed.
Here's the problem. Everything works fine until I try and add a htaccess line to rewrite to www. The entire htaccess in the /shop/ directory is :
# php_value session.auto_start 0
RewriteEngine On
# RewriteCond %{HTTP_HOST} !^www\.##########\.com$ [NC]
# RewriteRule ^(.*)$ http://www.##########.com/$1 [L,R=301]
# ONLY rewrite URIs beginning with /shop/
RewriteCond %{REQUEST_URI} ^/shop/ [NC]
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/shop/eleanor [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/shop/editors [NC]
# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel [NC]
RewriteCond %{REQUEST_URI} !/frontend [NC]
# Handle all other URIs using Zen Cart (index.php)
RewriteRule .* index.php?%{QUERY_STRING} [L]
Evidently I am trying to uncomment two of those lines.
However when I do this everything continues to work fine except:
https://www.domain.com/shop/lamps - this works fine
domain.com/shop/lamps - this does not work
what happens with the second example is that the URL is rewritten to https://www.domain.com/lamps ( without the /shop/ ) which gives a 404 error.
Here is the section of configure.php ( with some stuff hashed out)
// Define the webserver and path parameters
// HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
// HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
define('HTTP_SERVER', 'http://www.##########.com');
define('HTTPS_SERVER', 'https://www.##########.com');
// Use secure webserver for checkout procedure?
define('ENABLE_SSL', 'true');
// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_CATALOG', '/shop/');
define('DIR_WS_HTTPS_CATALOG', '/shop/');
Got to say I am confused but maybe I have made an error in the installation. Without the www rule for htaccess the results are this:
https://www.domain.com/shop/lamps - this works fine
domain.com/shop/lamps - this works fine