Search
 
SCRIPT & CODE EXAMPLE
 

PHP

301 redirect

#In .htaccess
  
Redirect 301 /old-page https://www.example.com/new-page
Comment

301 redirect

301, "Moved Permanently"—recommended for SEO
302, "Found" or "Moved Temporarily"
Meta Refresh 
Comment

301 redirect http to https

#For apache .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Comment

how to create a 301 redirect with domain.com

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^DOMAIN.com [NC]
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.DOMAIN.com/$1 [R=301,L]
Comment

Simple 301 redirect

<?php
header("Location: https://softhunt.net", true, 301);
exit();
?>
Comment

301 redirect

#http to https and www to non-www
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteCond %{HTTP_HOST} ^(?:www.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
Comment

Permanent 301 redirect

<?php
//* Permanently redirect page
header("Location: new_page.php",TRUE,301);
?>
Comment

PREVIOUS NEXT
Code Example
Php :: laravel db query log string replacements 
Php :: Rename route resource in laravel 
Php :: wp_query custom post type 
Php :: laravel one to many relationship example 
Php :: laravel controller middleware example 
Php :: laravel save file or picture directory 
Php :: twig in array 
Php :: ErrorException symlink(): No such file or directory 
Php :: sha256 php cantidad caracteres 
Php :: specify php version composer 
Php :: console.log for php 
Php :: quitar html con laravel 5 
Php :: select randomly from mysqli php 
Php :: laravel select only one word from string 
Php :: wp large medium large 
Php :: rodar migration laravel 
Php :: Detect the page realod in php 
Php :: php empy a file 
Php :: intellisense in visual studio code for php-oop 
Php :: php get today at 3pm 
Php :: php simple sse 
Php :: send data with href 
Php :: wordpress raw query 
Php :: wordpress convert object to array 
Php :: carbon now set timezone 
Php :: php mysqli date between 
Php :: php check if input is a positive integer 
Php :: c# to php 
Php :: Laravel get all parent categories for each category 
Php :: lookup token information in vault 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =