ksookma:
We have always used Ulitmate SEO URL. The problem is that we are not able to add the www canonical redirect to the .htaccess file now. It just breaks the site. I have tried adding it to the beginning after the rewrite base rule and at the end of the file but no luck. Has anyone else encountered this problem?
No, my htaccess redirect works on my 1.5.1 cart with Ultimate SEO. I'm copying my htaccess below the asterisks - note that my settings for Ultimate SEO may differ from yours.
I know what you mean about the initial canonical www. But since Zencart doesn't do anything about it I wonder if it's really that big of an issue. Also, one can set their google webmasters to show the www and non-www versions and indicate to google which is the canonical, which is probably a good idea since it's all about google.
Nevertheless, just the other day I included the canonical redirect in my htaccess.
But note that before I could add the non-www the other day in my google webmasters I had to briefly remove the htaccess canonical redirect to verify the non-www version.
ErrorDocument 404 /errors/notfound.html
ErrorDocument 500 /errors/internal_error.html
NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
Disable if using "Categories as Directories"
RewriteRule ^(.)-c-([0-9_]+)/(.)-p-([0-9]+).html$ $3-p-$4.html?cPath=$2&%{QUERY_STRING} [R=301,L]
Enable only if using "Categories as Directories"
#RewriteRule ^(.)-c-([0-9_]+)/(.)-p-([0-9]+).html$ index.php?main_page=product_info&products_id=$4&cpath=$2&%{QUERY_STRING} [L]
Normal operation Ultimate SEO URLs
RewriteRule ^(.*)-p-([0-9]+).html$ index.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
Disable if using "Categories as Directories"
RewriteRule ^(.)-c-([0-9_]+).html$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-c-([0-9_]+)/$ $1-c-$2.html [R=301,L]
Enable only if using "Categories as Directories"
#RewriteRule ^(.)-c-([0-9_]+)/?.html$ $1-c-$2/ [R=301,L]
#RewriteRule ^(.)-c-([0-9_]+)$ %{REQUEST_URI}/ [R=301,L]
#RewriteRule ^(.*)-c-([0-9_]+)/$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
Normal operation Ultimate SEO URLs
RewriteRule ^(.)-m-([0-9]+).html$ index.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-pi-([0-9]+).html$ index.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-pr-([0-9]+).html$ index.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-pri-([0-9]+).html$ index.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+).html$ index.php?main_page=page&id=$2&%{QUERY_STRING} [L]
All other pages
Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index.php?main_page=$1&%{QUERY_STRING} [L]
Handle when a resource is not found (404 Error Page)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?main_page=page_not_found&%{QUERY_STRING} [L]
RewriteCond %{HTTP_HOST} ^prommart.com$ [NC]
RewriteRule ^(.*)$ http://www.prommart.com/$1 [R=301,L]
the following makes sure the correct mime type is sent for the .htc file
AddType text/x-component .htc
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 year"
</IfModule>
FileETag INode MTime Size
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>