如何在php中为重复URL AB文本添加查询字符串
现在我使用PHP进行我的工作,它有大约20页。我需要复制所有的URL以及AB测试的查询字符串如何在php中为重复URL AB文本添加查询字符串,php,Php,现在我使用PHP进行我的工作,它有大约20页。我需要复制所有的URL以及AB测试的查询字符串 Original : www.lorem.com/index.php Duplicate: www.lorem.com/index.php?custom (Something like that) 感谢您的团队一个好的解决方案是在.htaccess文档中使用URL重写方案。类似于以下的解决方案可能有效: <IfModule mod_rewrite.c> RewriteEngine On R
Original : www.lorem.com/index.php
Duplicate: www.lorem.com/index.php?custom (Something like that)
感谢您的团队一个好的解决方案是在
.htaccess
文档中使用URL重写方案。类似于以下的解决方案可能有效:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)/custom$ /$1-test.php [QSA,NC,L]
</IfModule>
请查看以下内容,以供URL重写参考:
Original : www.lorem.com/index.php
Duplicate : www.lorem.com/index-test.php (When /custom is appended, this page is shown)