redirect in htaccess code example
Example 1: https redirect htaccess
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) https:
Example 2: htaccess redirect to html page
RedirectMatch 301 ^/blog/about /blog/about.html
Example 3: https and www htaccess redirecr
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* https:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https:
Example 4: htacces redirect
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.vecchiodominio\.com$
RewriteRule (.*) http:
RewriteCond %{HTTP_HOST} !^vecchiodominio\.com$
RewriteRule (.*) http: