Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 06-25-2008 15:07:31

wyattea
Member
Registered: 01-07-2006
Posts: 1650

redirecting non-www url to www url - will this change work?

Hi Guys, I want to redirect my non-www url to my www url.  I don't know enough about rewrite rules to know if this will affect my existing seo rewrite rules...here's the code:

Code:

ErrorDocument 404 /404.html

Options +FollowSymLinks
        RewriteEngine On
          RewriteRule ^category/(.*)\.php           index.php?app=ccp0&ns=catshow&ref=$1  [L,PT]
        RewriteRule ^gift/(.*)\.php               index.php?app=ccp0&ns=prodshow&ref=$1 [L,PT]
        RewriteRule ^reference/(.*)\.php          index.php?app=ccp0&ns=display&ref=$1  [L,PT]
        RewriteRule ^store-specials.php           index.php?app=ccp0&ns=prodspec        [L,PT]
        RewriteRule ^new-products.php             index.php?app=ccp0&ns=prodnew         [L,PT]
        RewriteRule ^view-all-products.php        index.php?app=ccp0&ns=prodall         [L,PT]
        RewriteRule ^product-index.php            index.php?app=ccp0&ns=prodidx         [L,PT]
        RewriteRule ^best-sellers.php             index.php?app=ccp0&ns=prodbest        [L,PT]
        RewriteRule ^advanced-product-search.php  index.php?app=ccp0&ns=prodsearch      [L,PT]
        RewriteRule ^contact-us.php               index.php?app=ccp0&ns=contact         [L,PT]
        RewriteRule ^view-shopping-cart.php       index.php?app=ccp0&ns=viewcart        [L,PT]
        RewriteRule ^order-status.php             index.php?app=ccp0&ns=acctorders      [L,PT]
          
          RewriteRule ^account-maintenance.php      index.php?app=ccp0&ns=accountmaint    [L,PT]
          RewriteRule ^change-email-address.php     index.php?app=ccp0&ns=changeemail     [L,PT]
          RewriteRule ^change-password.php          index.php?app=ccp0&ns=changepass      [L,PT]
          RewriteRule ^address-book.php             index.php?app=ccp0&ns=addbook         [L,PT]
          RewriteRule ^account-logout.php           index.php?app=ccp0&ns=logout_proc     [L,PT]
          
          RewriteRule ^(.*)-(.*)/(.*)\.php          index.php?app=$1&ns=$2&ref=$3         [L,PT]

RewriteCond %{HTTP_HOST} ^mysite.com
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]

The 'new' stuff I'm adding is just these two lines:

Code:

RewriteCond %{HTTP_HOST} ^mysite.com
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]

Any problems with adding this?

Offline

 

#2 06-26-2008 09:38:46

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: redirecting non-www url to www url - will this change work?

Nope, I use exactly that!!

I would place as first rule in htaccess however.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#3 06-26-2008 21:25:14

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: redirecting non-www url to www url - will this change work?

I assume you mean right after Rewrite Engine On?

Offline

 

Board footer