wp-media / wp-rocket-helpers

🚀 Helper plugins for specific use cases with WP Rocket. ☝️ TEST BEFORE USE! ☝️
https://wp-rocket.me/support/
GNU General Public License v2.0
202 stars 68 forks source link

Update hard-coded domain #10

Open Garconis opened 6 years ago

Garconis commented 6 years ago

It would be nice if this plugin did 1 of these two things:

In addition, I think it would be beneficial if the "default" protocol was https instead of http. Especially since most sites these days should/are using https now. If someone needs http (non-s), they could be the ones to update the file... rather than forcing us who are following best practices by already using https.

#www to non-www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
arunbasillal commented 6 years ago

Hello @Garconis

Which helper plugin are you talking about here?

Garconis commented 6 years ago

Htacess, of course: https://github.com/wp-media/wp-rocket-helpers/tree/master/htaccess/wp-rocket-htaccess-nonwww-www

Would also be nice to have a single htacess helper, where all the options can me toggled on a page.