HTTP → HTTPS Yönlendirme
SSL sertifikası kurduktan sonra tüm HTTP trafiğini HTTPS'e yönlendirmeniz gerekir.
Apache (.htaccess)
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Nginx
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$server_name$request_uri;
}
IIS (web.config)
<rewrite>
<rules>
<rule name="HTTPS Redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
PHP
if (!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] !== "on") {
header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"], true, 301);
exit;
}
WordPress (wp-config.php)
define('FORCE_SSL_ADMIN', true);
define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');