【发布时间】:2015-01-14 20:47:08
【问题描述】:
http://my-domain.com/ppc-landing-page.php?Campaign=Boynton-Beach&AdGroup=Security%20System&Keyword=The%20Best%20Home%20Security%20System%20Company
我希望将其重写为
http://my-domain.com/Boynton-Beach/Boynton-Beach.php?Campaign=Boynton-Beach&AdGroup=Security%20System&Keyword=The%20Best%20Home%20Security%20System%20Company
并显示 ppc-landing-page.php 中的内容
思路是获取Campaign查询参数的值,将浏览器中的url重写为
http://my-domain.com/{$_GET['Campaign']}/{$_GET['Campaign']}.php?Campaign=Boynton-Beach&AdGroup=Security%20System&Keyword=The%20Best%20Home%20Security%20System%20Company
完整的查询字符串应该在那里
然后它应该将 ppc-landing-page.php 中的 $_GET 值替换为查询字符串中的值并显示内容。
【问题讨论】:
标签: php apache .htaccess mod-rewrite url-rewriting