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.
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:
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:
RewriteCond %{HTTP_HOST} ^mysite.com RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
Any problems with adding this?
Offline
Nope, I use exactly that!!
I would place as first rule in htaccess however.
Offline
I assume you mean right after Rewrite Engine On?
Offline