How to add 301 redirects in PHP?

by heather_fritsch , in category: Technology , a year ago

How to add 301 redirects in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by aaliyah , a year ago

You can add 301 redirect in PHP by adding below code snippet in your file.


1
2
3
header("HTTP/1.1 301 Moved Permanently"); 
header("Location: /option-a"); 
exit();