Mod Rewrite/htaccess file

General ShopSite user discussion

Mod Rewrite/htaccess file

Postby craig » Thu Nov 02, 2006 1:07 pm

I am trying to use the following code in my htaccess file to avoid duplicate content issues with the search engines.

RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*\/index\.html
RewriteRule ^(.*)index\.html$ http://www.example.com/$1 [R=301,L]

The first part that rewrites example.com to www.example.com causes problems with Shopsite's backend and the functions like publish do not work. Does anyone know how to solve this? Thanks in advance for your help. By the way, Pair is my Shopsite host.

Craig
craig
 
Posts: 7
Joined: Sun Aug 13, 2006 2:54 am

Postby robm » Thu Nov 02, 2006 1:21 pm

Try:

Code: Select all
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*) http://www.example.com/$1 [L,R=301]

This is more selective and may not interfere with ShopSite. It will rewrite the URL to www.example.com for just example.com being used in the URL.
robm
 
Posts: 463
Joined: Fri Aug 04, 2006 5:46 pm
Location: Connecticut


Return to User Forum

Who is online

Users browsing this forum: Google [Bot] and 87 guests