Forum Moderators: phranque

Message Too Old, No Replies

.htaccess for zencart

adding www alongside other rewrite rules

         

rhlee

3:17 pm on Apr 9, 2009 (gmt 0)

10+ Year Member



Hi all,

I have a nagging problem with adding an "add www" rule to my Zen Cart htaccess file. The are some existing rules there for SEO. But I can't seem it to rewrite mydomain.com to www.mydomain.com whilst keeping the functionality of the existing rules.

Here is the current .htaccess file:

#### BOF SSU
Options +FollowSymLinks -MultiViews
RewriteEngine On
# Make sure to change "zencart" to the subfolder you install ZC. If you use root folder, change to: RewriteBase /
RewriteBase /zencart/

# Deny access from .htaccess
RewriteRule ^\.htaccess$ - [F]

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*) index.php?/$1 [E=VAR1:$1,QSA,L]
#### EOF SSU

Any help would be much appreciated.

Richard

jdMorgan

3:42 pm on Apr 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Without seeing the www canonicalization code, all I can say is to put the www redirect ahead of the internal rewrite(s).

Jim