How to add 301 redirects in PHP?

Member

heather_fritsch

by heather_fritsch , in category: Technology , a month ago

How to add 301 redirects in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by aaliyah , a month 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();