Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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]
</IfModule>

I know I can use:

Redirect permanent /login https://mysite.example.com/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 https://mysite.example.com/login? –  hitautodestruct Nov 13 '13 at 8:02
    
@MichaelHampton Please reconsider reopening the question. Thanks. –  hitautodestruct Nov 14 '13 at 8:58

1 Answer 1

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

 
discard

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.