Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php 301 redirect

<?php // Permanent 301 Redirect via PHP
	header("HTTP/1.1 301 Moved Permanently");
	header("Location: http://domain.tld/new/location/");
	exit();
?>
Comment

301 redirect htaccess

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ http://domain2.com/$1 [L,R=301,NC]
Comment

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 :: replace text in string php 
Php :: php check if multiple inputs are empty 
Php :: laravel value eloquent 
Php :: php array to array collection 
Php :: laravel unique validation on multiple columns 
Php :: laravel sanctum axios Unauthenticated 
Php :: accessing json data in php 
Php :: Eloquent models events 
Php :: new session php 
Php :: wherein elequent 
Php :: date format with t and z php 
Php :: special characters in php 
Php :: laravel collective form include image 
Php :: php proper function comments 
Php :: wc php if is product category page 
Php :: add javascript to functions.php 
Php :: laravel carbon time format 
Php :: laravel package for getID3() 
Php :: upload video in laravel 
Php :: __invoke in laravel 
Php :: update column value laravel 
Php :: php super 
Php :: remove colon and white space in a string by php 
Php :: PHP MySQL Use The WHERE Clause 
Php :: laravel local scope 
Php :: ci constructor 
Php :: php require 
Php :: luhn algorithm credit card checker php 
Php :: php array sort by key 
Php :: do artisan laravel in code 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =