RedirectMatch uses a regular expression that is matched against the URL path. And your regular expression
/contact.php just means any URL path that contains
/contact.php but not just any URL path that is exactly
/contact.php. So use the anchors for the start and end of the string (
RedirectMatch 301 ^/contact\.php$ /contact-us.php
redirect 301 /contact.php /contact-us.php
John is a freelance Full Stack Developer. Experienced in PHP, Laravel and Vue3/Nuxt3 he can code anything you need.
Based in South Africa, I am available for PHP, Laravel or Vue3/Nuxt3 freelance jobs in person or remotely.