WordPress register special URL

How can I register a special url (slug) in WordPress so that I don’t get an 404?

At the moment I set the status_header to 200 but I think that is not the right way? right?

if (is_404())
{
     $curUrl_arr = explode("/", preg_replace("/^//", '', $_SERVER['REQUEST_URI']));
     if($curUrl_arr[0] == 'XXXXXX')
     {
            status_header(200);
            // some code
     }
}

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Read more here: WordPress register special URL

Leave a Reply

Your email address will not be published. Required fields are marked *