- Redirect a page to another using HTML
- HTTP 301 Redirect using PHP
- Redirect a site to HTTPS using PHP
- Redirect a site to www using PHP
- Redirect HTTP to HTTPS when using Reverse Proxy
- Redirect site from www to non-www
- Redirect site to HTTPS excluding a folder
- Redirect a folder to another
- Fix Canonical URL using .htaccess
- WordPress Redirect Visitor On 404 Error
Nginx
- Nginx Redirect
- Nginx remove html from url
- How to redirect a domain with html extension in Nginx
- Nginx Redirect HTTP to HTTPS
IIS
Redirect a site to HTTPS using .htaccess file
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Redirect a web site to SSL using Apache Virtual Host
ServerName www.yourdomain.com
Redirect permanent / https://www.yourdomain.com/
OR
RewriteEngine on
RewriteCond %{SERVER_NAME} =yourdomain.com [OR]
RewriteCond %{SERVER_NAME} =www.yourdomain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
Redirect a Site to HTTPS using PHP
if ($_SERVER["HTTPS"] != "on") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://www.yourdomain.com");
}
Redirect www to non-www URL
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ https://yourdomain.com/$1 [L,R=301]
Leave a Reply