Simplifying the updates to .htaccess made by WPFC
-
On plugin activation, WPFC inserts several groups of directives at the start of .htaccess. I am trying to understand (and suggest simplified versions of) some of the directives in the <IfModule mod_rewrite.c> section.
1. There are several RewriteCond directives. This one:
RewriteCond %{HTTP:Cookie} !^.*(comment_author…woocommerce_session).*$
could be simplified to:
RewriteCond %{HTTP:Cookie} !(comment_author…woocommerce_session)2. There are 2 RewriteRule directives:
RewriteRule ^(.*)$ http\:\/\/www\.example\.com\/$1 [R=301,L]
RewriteRule ^(.*) “/mydirectory/wp-content/cache/all/$1/index.html” [L]It is not necessary to:
– escape any characters in RewriteRule destinations
– enclose an internal rewrite destination in quotes
– start an internal rewrite destination with a forward slashCan I suggest that you standardise and simplify these 2 RewriteRules to:
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
RewriteRule ^(.*)$ mydirectory/wp-content/cache/all/$1/index.html [L]I have successfully tested all of the above with WPFC and Apache v2.4.18 on Linux.
After we have discussed/clarified the above, I have comments about several other directives within the same <IfModule mod_rewrite.c> section.
- The topic ‘Simplifying the updates to .htaccess made by WPFC’ is closed to new replies.