PHP పేజీ నుండి URLకి దారి మళ్లిస్తుంది.PHP 301 దారిమార్పు.
ఈ PHP దారి మళ్లింపు HTTP ప్రతిస్పందన స్థితి కోడ్ని అందించాలి: 301 శాశ్వతంగా తరలించబడింది.
పాత URL నుండి కొత్త URLకి పేజీ ర్యాంక్ని బదిలీ చేయడానికి శోధన ఇంజిన్లు 301 ప్రతిస్పందన స్థితి కోడ్ని ఉపయోగిస్తాయి.
old-page.php కోడ్ని కొత్త-page.phpకి దారి మళ్లింపు కోడ్తో భర్తీ చేయండి.
old-page.php:
<?php
// PHP permanent URL redirection
header("Location: http://www.domain.com/new-page.php", true,
301);
exit();
?>
పాత పేజీలో తప్పనిసరిగా .php ఫైల్ ఎక్స్టెన్షన్ ఉండాలి.
కొత్త పేజీ ఏదైనా పొడిగింపుతో ఉండవచ్చు.
php-redirect-test.php
<?php
// PHP permanent URL redirection test
header("Location:
https://cmtoinchesconvert.com/te/web/dev/php-redirect.html", true, 301);
exit();
?>
php-redirect-test.php నుండి ఈ పేజీకి తిరిగి మళ్లించడానికి ఈ లింక్ని నొక్కండి:
PHP దారిమార్పు పరీక్ష - PHP ఫైల్
php-redirect-test.htm
<?php
// PHP permanent URL redirection test
header("Location:
https://cmtoinchesconvert.com/te/web/dev/php-redirect.html", true, 301);
exit();
?>
html ఫైల్ php-redirect-test.htm నుండి PHP దారి మళ్లింపు సాధారణంగా .htaccess లేదా httpd.conf ఫైల్లో ప్రారంభించబడితే తప్ప, .html ఫైల్ పొడిగింపు కారణంగా పని చేయదు:
PHP దారిమార్పు పరీక్ష - HTML ఫైల్
HTML ఫైల్లలో PHPని ప్రారంభించడానికి ఈ కోడ్ని .htaccess లేదా httpd.conf ఫైల్కి జోడించండి:
Addtype application/x-httpd-php .htm .html
Advertising