tag:blogger.com,1999:blog-865923359735383241.post2622586824815746442..comments2023-10-29T07:27:09.012-06:00Comments on Ccna final exam - java, php, javascript, ios, cshap all in one: How do you redirect HTTPS to HTTP?Unknownnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-865923359735383241.post-29216394213056694092012-06-08T19:18:18.482-06:002012-06-08T19:18:18.482-06:00I'm currently tring to direct http://server1 t...I'm currently tring to direct http://server1 to http://server2.<br />Because server1 is https it should be https://server1 to http://server2.<br /><br />When I tried the code on my server,<br /><br />RewriteCond %{HTTPS} on<br />RewriteRule (.*) <http://%>{HTTP_HOST}%{REQUEST_URI}<br /><br /><br />my server is not redirecting it. In fact, there's no log in rewrite.log even though I've set it to level 9.<br /><br />After some tests, it would seems that the rewriting doesn't work when it's https.<br />There's no log at all.<br />If I revert back to http://server1, then the log came out.<br /><br />So is it when https is used, the redirecting doesn't work?<br />That couldn't be the case seeing that other people manage to get it going.<br />But then, how come there's no rewrite.log?<br /><br />Update<br /><br />After some more tests, I found that because the httpd.conf put the SSL code in another file (there's a line which says Include conf/extra/httpd-ssl.conf)<br />I need to put the rewrite code inside the httpd-ssl.conf file instead.<br />Now the rewrite log is showing.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-88973204722139876112012-06-08T19:18:14.302-06:002012-06-08T19:18:14.302-06:00ejunker's got it right. For all the examples ...ejunker's got it right. For all the examples that have you redirect from port 80, substitute port 443 as the conditional.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-13347438969705450652012-06-08T19:18:07.721-06:002012-06-08T19:18:07.721-06:00Keep in mind that the Rewrite engine only kicks in...Keep in mind that the Rewrite engine only kicks in once the HTTP request has been received - which means you would still need a certificate, in order for the client to set up the connection to send the request over!<br /><br />However if the backup machine will appear to have the same hostname (as far as the client is concerned), then there should be no reason you can't use the same certificate as the main production machine.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-42328641013974117112012-06-08T19:18:04.956-06:002012-06-08T19:18:04.956-06:00This has not been tested but I think this should w...This has not been tested but I think this should work using mod_rewrite<br /><br />RewriteEngine On<br />RewriteCond %{HTTPS} on<br />RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.com