如何在不丢失流量的情况下为旧的RewriteRule创建规则到新的RewriteRule

时间:2019-03-11 06:32:05

标签: php .htaccess mod-rewrite

我现在有旧的重写url,我想更改模式并且不想失去来自Google索引页面的访问量。

OLD RewriteRule和php代码

//php code
<?php echo SITE_URL .''. $rw['album_url'].'-album-1'; ?>

//output url
http://example.com/album-title-great-new-album-1

//.htaccess rule
RewriteRule ^(.*)-album-(.*)$ album.php?album_url=$1&page=$2 [L]

我希望将其更改为不丢失流量。

//php code
<?php echo SITE_URL .''.$rw['album_id'].'/album/'.$rw['album_url']; ?>

//output url
http://example.com/523/album/album-title-great-new

0 个答案:

没有答案