0
Welcome Guest! Login
0 items Join Now

Redirect non existing pages to custom 404 page

    • sklar's Avatar
    • sklar
    • Hero Rocketeer
    • Posts: 263
    • Thanks: 1

    Redirect non existing pages to custom 404 page

    Posted 8 years 1 week ago
    • Hi

      I have been playing around trying to get some non existing (404) pages from the old website to jump to a new website's page.

      I wonder when I add this code to the error.php file (located in the template folder of RT_Salient) if it will work? Maybe Gantry overrules? I am afraid to try, because it's a live website. Or is there a better way to redirect non existing pages?


      if (($this->error->getCode()) == '404') { header('HTTP/1.0 404 Not Found'); $errorPageContent = file_get_contents(' griffid.com/index.php/en/404
      '); echo $errorPageContent; exit; }

      Thanks!

      best regards, Chantal
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: Redirect non existing pages to custom 404 page

    Posted 8 years 1 week ago
    • I am not quite sure I understand you. If you just wanted to redirect one url to another you could use an htaccess rule or any extension such as SH404SEF. If in turn the page you redirected to was a non-existing url on th enew site then it would should the custom 404 page anyway?

      Regards, Mark.
    • The following users have thanked you: sklar

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.

Time to create page: 0.051 seconds