Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tried everything but simply can't get this to work.

This is the default Wordpress redirect code that sits in my htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

I know I can use:

Redirect permanent /login

But this won't allow me to capture all url's and redirect them.

How would I redirect all incoming urls to https?

share|improve this question
@MichaelHampton So, where should I add this when talking about the above rewrite code Redirect permanent /login – hitautodestruct Nov 13 '13 at 8:02
@MichaelHampton Please reconsider reopening the question. Thanks. – hitautodestruct Nov 14 '13 at 8:58
up vote 0 down vote accepted

You shouldn't use .htaccess unless you have to. Wordpress has enough security issues without including another + performance slowdown.

That being said, if you're just trying to protect login/admin data you can edit the wp-config.php file to included; require_once(ABSPATH . 'wp-settings.php'); and define('FORCE_SSL_LOGIN', true);

Also, you can force everything in SSL with the following rewrite rule;

RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.