webdirexion
asked on
Best way to understand Apache Rewrite Implications
Hi -
A client has the following rewrite code in his .htaccess file:
I would like to :
a) translate each line into an understanding of what the code does (ie. last line means something like "wildcard redirect all links to this domain to the home page", and I think the first line is about forcing www to be in the domain name. );
b) understand the options to change it should we judge it to be not the best rewrite for SEO. Here, I am wondering if someone can point us at a good reference for those that don't write apache code often.
Final question: what if the domain is going to https -- must that be described in this code?
Thanks -
Scott
A client has the following rewrite code in his .htaccess file:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
I would like to :
a) translate each line into an understanding of what the code does (ie. last line means something like "wildcard redirect all links to this domain to the home page", and I think the first line is about forcing www to be in the domain name. );
b) understand the options to change it should we judge it to be not the best rewrite for SEO. Here, I am wondering if someone can point us at a good reference for those that don't write apache code often.
Final question: what if the domain is going to https -- must that be described in this code?
Thanks -
Scott
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This was a well-crafted answer. Thanks.
However, if they entered https://www.yoursite.com, there would be no re-write because the hostname starts with www.