selladurai
selladurai

Reputation: 6779

how to redirect http call to https in delphi web server?

How to redirect HTTP call to HTTPS in delphi web server. I'm using Delphi stand alone web server and i installed SSL in my server. when I give request protocol as HTTPS, it working but I want to redirect HTTP to HTTPS. Can any one tell how to redirect?

Upvotes: 2

Views: 1355

Answers (1)

mrabat
mrabat

Reputation: 912

If you have direct access to the webserver (e.g. you are creating an isapi or apache module) itself and you are in charge of the response you should use an http redirect as described on http://en.wikipedia.org/wiki/HTTP_301

Another (not recommended) variant is to output a html file like this:

<html>
<head>
<meta http-equiv="Refresh" content="0; URL=https://www.anewsite.com/">
</head>
<body></body>
</html>

Upvotes: 5

Related Questions