Developers

.htaccess, redirects and permissions

Common rules and safe file permissions.

Send everyone to https://www

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.yourdomain.com%{REQUEST_URI} [L,R=301]
  • Files: 644. Folders: 755.
  • Config files with passwords (wp-config.php): 600 or 640.
  • Never use 777.

Only need HTTPS? Use Always use HTTPS in Settings & backups instead of a rule.

Still stuck?

A real person replies within 24 hours.