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 have an old legacy website that I have migrated to wordpress.

Some of the functionality will remain on the old server and be accessed via IP address, however this functionality requires a secure http connection and our current certificate is valid for the domain name which is being switched across.

I have added a redirect using mod_write to our htaccess file

Redirect /mySecurePage https://99.99.99.99/mySecurePage

However a warning is presented to user as certificate is registered to the domain name - the same domain name which now points to different ip (insecurely, and redirects to secure page on old server/different ip).

What is the best solution ?

I have full access to both servers, but wanted to avoid transferring the old functionality across to new server - its a right mess. Can I change the certificate, or do some fancy url rewriting ?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Add a subdomain legacy.yourdomain.com and let this subdomain serves as the old legacy website.

Then replace the IP in the "Redirect" rule with the subdomain you created.

share|improve this answer
    
OK, I think I understand, thats very clever. –  NimChimpsky Dec 18 '12 at 12:46
    
Wouldn't this only work if he has a wildcard certificate for the domain. If the cert is for www.localtest.me than redirecting the request to legacy.localtest.me still throws the SSL warning. –  Peter Hahndorf Dec 18 '12 at 14:14
    
@PeterHahndorf I do have a wildcard certificate, it looks like it saved me a lot of headache. This answer is one of the best answers I have received on stack sites, I love the lateral thinking. –  NimChimpsky Dec 18 '12 at 20:34

Redirect

You can use the Redirect Option as already mentioned. You are correct that you will need to use a SSL certificate that matches the old domain exactly.

Often two single SSL certificates are cheaper than a wildcard.

Proxy Method

You can use a SSL Proxy on your new server to proxy traffic to the old system.

See the ProxyPass directives.
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass

Also don't forget: SSLProxyEngine On http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslproxyengine

Unless you want to not add a new domain, I would opt for the redirect version. It is a much less complicated and simple implementation.

If the site is for internal use, just buy a cheap SSL certificate for that legacy domain.

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.