.htaccess coding query - deleting PHP rewrite code

I have this code in my .htaccess file. I have forgotten what each line of code is doing!

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\\.sitename\\.co.uk$ [NC]
RewriteRule .? http://www.sitename.co.uk%{REQUEST_URI} [R=301,L]
Options -MultiViews
RewriteCond %{REQUEST_URI} ^/productcode
RewriteCond %{QUERY_STRING} product=([a-zA-Z0-9-]+)&code=([a-zA-Z0-9-]+)
RewriteRule .? /%1%2? [L,R=301]

We decided not to use PHP on the website. I think this means I can delete this code from the .htaccess file, right?:


Options -MultiViews
RewriteCond %{REQUEST_URI} ^/productcode
RewriteCond %{QUERY_STRING} product=([a-zA-Z0-9-]+)&code=([a-zA-Z0-9-]+)
RewriteRule .? /%1%2? [L,R=301]

Can you also tell me what this code is doing, please?:

RewriteCond %{HTTP_HOST} !^www\\.sitename\\.co.uk$ [NC]
RewriteRule .? http://www.sitename.co.uk%{REQUEST_URI} [R=301,L]

The reason for getting rid of the PHP rewrite code is we do not need it and it is causing some errors in Google Analytics (suggesting we have some PHP files with errors when we do not).

I look forward to your comments,

Matt.

Hi Matt,

Oh, my! I just (politely) chastised another member for not knowing what his code is doing … but you do get credit for asking.

Regards,

DK