You have to do this in /app/config/bootstrap.php

something like:
        if($_SERVER["REQUEST_URI"]==$oldurl){
                header("HTTP/1.1 301 Moved Permanently");
                header("Location:" . $newurl);
                exit();
        }


On Jun 17, 6:17 pm, jabocs <ja...@jnjhardy.com> wrote:
> Any help please?
>
> I'm trying to give my CMS users the ability to declare a custom URL
> 301 redirects to a new page in their new websites.
>
> Basically, I want to have a Table in my MySQL table that contains
> OldURL and NewURL ...
>
> I would like to be able to compare a URL inside of CakePHP before it
> actually tries to process it.
>
> In other words if somebody types inhttp://www.mydomain.com/test/gravy.html
> ... that it can look at the URL and compare it to the OldURL fields in
> my new table...
>
> If I find a match, then send it to a controller that takes that URL
> and creates a 301 redirect header to the NewURL field of the table.
>
> I thought about maybe beforeFilter but that's too far in at that point
> after it errors out... are there any "beforeSomething" that I'm not
> aware of?
>
> Any thoughts?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to