Hi all,
Over 40 000 pages of our app are indexed by Google.
We want now to enable routing. So all urls have to be changed... In
order to avoid black listing of new ones, the 301 error must be returned
when accessing old urls.
For instance, we have 3 rules like :
my_route_name1:
url: /page1.html
param: ( module: mymodule, action: myaction, fixedParam: 1 )
my_route_name2:
url: /page2.html
param: ( module: mymodule, action: myaction, fixedParam: 2 )
my_route_name3:
url: /page3.html
param: ( module: mymodule, action: myaction, fixedParam: 2 )
I'm working around testing the route name in action.
if (sfRouting::getInstance()->getCurrentRouteName() != my_route_name1)
{
$this->getResponse()->setStatusCode(301, 'Moved permanently');
$this->redirect($this->getController()->genUrl(sfRouting::getInstance()->getCurrentInternalUri()
. '?fixedParam=' . $this->getRequestParameter('fixedParam'), true));
}
I'm not sure that the error code is really sent. Did anyone worked on
the same issue ?
Another question: is there a method like getCurrentInternalUri()
containing all the parameters (in my case fixedParam) ?
Thanks,
--
Nicolas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---