HTTPS to HTTP .htaccess redirect

Hi,

I recently moved my forum to a new URL.

Old forum was located at: olddomain.com/forum/
and new one: newdomain.com/

I used the following 301 redirect:

Options +FollowSymLinks
RewriteEngine on
RewriteRule forum/(.*) http://www.newdomain/$1 [R=301,L]

redirect 301 / http://www.newdomain.com/

Now I just noticed that there are thousands of old forum pages indexed at Google with “https” in front of them and when clicked, all you get is some error page. So I would need to redirect https://www.olddomain.com/forum/something/ to
http://www.newdomain.com/something/

I think I’ve tried everything but I just can’t seem to find a way to redirect https requests to http.

Any ideas?

If your server isn’t configured for https (and it sounds like it isn’t, hence the error page), you can’t redirect, since you only redirect URLs that Apache can actually serve.

What kind of error page do you get exactly?

Harri,

mod_alias (Redirect) is part of the Apache core thus its directives are handled BEFORE the mod_rewrite directives. That means that mod_rewrite will never see this code (unless olddomain.com === newdomain.com).

As always, the sticky threads based on my signature’s mod_rewrite tutorial Article has the answer for you … in code.

Regards,

DK