Salines
February 1, 2020, 10:32pm
1
Hello upgrading time, from 2 to 4
But I have question about redirection form old url to new format.
Example:
CakePHP 2:
Router::connect('/satovi/:id-:slug/*', array('controller'=>'watches','action'=>'view','id' => '[0-9]+'),array('pass' => array('id','slug'),'id' => '[0-9]+'));
This generate link like:
https://detas.ba/satovi/7555-Tissot_T101_917_11_116_00
Now we are in upgrading process, and we want all old incoming get request redirect to new url format.
example: …/satovi/tissot /t101-917… etc
Please recommend the most painless solution, from the SEO point of view.
Zuluru
February 1, 2020, 11:08pm
2
Do you want the URLs to all change, or are you just thinking that they have to? Because it seems like it should be possible to keep them the same, if you want to.
Salines
February 10, 2020, 8:50am
3
Yes, I want to redirect old URLs to new ones with code 302. Best place for such actions is middleware or router? Thanks.
Zuluru
February 10, 2020, 3:19pm
4
The lowest server overhead place to do redirection is in .htaccess
. Should be quite possible with regex matching.
1 Like
Salines
February 11, 2020, 8:37am
5
Hallo, thanks for your help