Tags
PHP
Asked 3 years ago
30 Jun 2021
Views 221
Raoul

Raoul posted

How to tell search engines that I have changed my website URLs?

How to tell search engines(google/yahoo/bing) that I have changed my website URLs?
i have some old pages which already have listed in google but i changed the url so it shows duplicate url at webmaster tool
so i want to tell the search enginee that i have new url for old url so how to do it ?
jabber

jabber
answered Jun 30 '21 00:00

you can try HTTP response status code 301 Moved Permanently is used for permanent redirecting.
301 redirect in PHP code

header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/categories.html");
header("Connection: close");
exit();


with .htaccess

RewriteEngine On
RewriteRule  ^index.php
http://www.newdomain.com/index.html  [R=301]


Post Answer