Forum Moderators: phranque

Message Too Old, No Replies

Unknown Rewrite condition / Rule - - Clueless

         

ryanwassi

9:46 am on Nov 22, 2006 (gmt 0)

10+ Year Member



Hi,

Please excuse my ignorance, I am clueless on this and simply cannot rap my head around it.

I haven't the foggiest what this directive is doing.
I'd like to add another condition / rule but would like to test that the addition of such will not effect what already exists in my .htaccess

Below is what is there now:

Options +FollowSymlinks

RewriteEngine On

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

Would anyone be able to tell me what this does?

As far as I can tell from an entirely uneducated guesstimate is it is rewriting [www....] onto queries such as mydomain.com

Please help -

Thank you>

jdMorgan

3:56 pm on Nov 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is externally redirecting requests for all pages in the non-www domain to those same pages in the www- domain, thus avoiding duplicate-content problems in the search engine listings. Search engine spiders/crawlers which encounter this redirect after requesting a page from the non-www domain will change the URL that they are using and listing in search results, and will instead use and list the www- URLs in the future.

You will often hear this referred to as "domain canonicalization" -- Here all non-canonical URLs are redirected to their canonical equivalent. And although "canonical" may be a new term for some, it simply means "usual, standard, or customary" in this application.

For more information on the code used to implement this function, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim