How to redirect dynamic pages with htaccess
I have some old indexed pages like:
index.php?action=addon_googlemap_showmap&listingID=XXXXX&popup=1
index.php?action=addon_googlemap_showmap&listingID=XXXXX&popup=yes
and I want to redirect them to new urls:
index.php?action=listingview&listingID=XXXXX
XXXXX开发者_运维问答 is a number.
What should I put in my htaccess file?
Thank you in advance.
mod_rewrite is not worth the headaches (especially in .htaccess).
I would strongly recommend you put a redirect in your index.php instead. Something like
<?php
if ($_GET['action'] == 'addon_googlemap_showmap') {
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://...../index.php?action=listingview&listingID=" . $_GET['listingID']);
exit();
}
精彩评论