0

I already have a rewrite rule in .htaccess. My old rule replaces all html extensions with php. My .htaccess:

RewriteEngine On
RewriteRule ^(.*).html$ index.php?set=$1

Now we have a SSL so now I want to redirct all url http to https with out affecting my old rule. I tried:

RewriteEngine On
RewriteRule ^(.*).html$ index.php?set=$1RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule ^(.*).html$ index.php?set=$1

With this, the https redirect is working but my old rule failed.

1 Answer 1

0

Instead of using rewrite for everything, why don't you use redirect to redirect all http connections to https?

Redirect / https://your.server.com/

Only add this redirect to the http virtual host (I'm assuming you're using virtual hosts to implement the https site).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .