|
برای ریدایرکت از HTTP به HTTPS از قطعه کد های زیر استفاده کنید.
برای سرویس های ویندوزی C# و ASP.net
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
برای سرویس های لینوکسی که از htaccess استفاده می شود :
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
|
شناسه مقاله: 1739, ایجاد شده: 2/2/2019 در 6:44 PM, تغییر یافته: 2/2/2019 در 6:44 PM