Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

301 directs and dashes

         

jjdesigns4u

10:08 pm on Jun 16, 2006 (gmt 0)

10+ Year Member



Just wanted to confirm if this is still a good code to use for fixing my www non-www problem

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST}!^www\.sitehere\.com [NC]
RewriteRule ^(.*) [sitehere.com...] [L,R=301]
</IfModule>

=====================

Also does everyone agree that dashes are better than underscores in a URL?

g1smd

12:35 am on Jun 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There needs to be a space BEFORE the! mark.

Avoid spaces and underscores in URLs.

Always use hyphens or dots instead.

Tami

1:08 am on Jun 21, 2006 (gmt 0)

10+ Year Member



This is what I use...

RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.sitehere\.com
RewriteRule (.*) [www\.sitehere\.com...] [R=301,L]

I see some differences, which is better?

Thanks
Tami

g1smd

8:18 pm on Jun 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You still need a space before the ! mark.