I was given a set or re-write rules for a new website. I've never used them before and I'm trying to understand what we are doing here
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.myco\.com
RewriteRule (.*) http://www.myco.com/$1 [R=301,L]
RewriteCond $1 !^(CCSFG|images|fonts|themes|robots\.txt|index\.php) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
If I understand this, the first ruleset
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.myco\.com
RewriteRule (.*) http://www.myco.com/$1 [R=301,L]
says:
If HTTP_HOST is anything AND
if HTTP_HOST doesn't start with www.myco.com
then
rewrite any page request to start with http://www.myco.com/, return a 301 redirect and stop processing more rules
The next ruleset
RewriteCond $1 !^(CCSFG|images|fonts|ee-system|themes|robots\.txt|index\.php) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
says: If the request doesn't start with CCSFG,image or fonts or, etc (non-case sensitive) then rewrite the whole request to prepend /index.php/ and stop processing more rules
Is my interpretation correct?
If so, what would be the purpose of the second ruleset? Why would I want to prepend /index.php/ to these entries?