I'm currently updating an existing live website to use pretty urls. I've got the urls working, but my problem is that after I've enabled pretty urls all of the old links from sites like Google etc will stop working. They simply redirect to the front page. Examples; Old url: http://www.dreambulgarianproperties.com/index.php?r=properties%2Fproperty%2Fview&id=37 Redirects to the front page
New url: http://www.dreambulgarianproperties.com/properties/property/view?id=37 as it should look from both urls.
My .htaccess file is this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1
and my UrlManager config is this;
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => false,
'rules' => [
'<action:\w+>' => 'site/<action>'
],
],
The site works fine, I'm just worried about losing Google traffic if I change the urls.
Is there a way of telling Yii to continue parsing old urls, while displaying and handling the new, pretty urls?