Answers for "apache 301 redirect mechanism"

PHP
1

301 redirect http to https

#For apache .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Posted by: Guest on October-02-2020
0

Simple 301 redirect

<?php
header("Location: https://softhunt.net", true, 301);
exit();
?>
Posted by: Guest on April-10-2022

Browse Popular Code Answers by Language