我正在尝试实现一个解决方案,让我的登录页显示添加的广告词。
我按照这里的说明:
http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/
但我不能让它工作。。。。
根据教程,我将此代码插入到.htaccess文件中:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+).html?$ index.php?q=$1 [L]
php文件中有如下代码:
<?php
// default
$replace = "Thailand";
if (isset ($_GET ['q'])) {
$replace = preg_replace("/-/" , " " , $GET['q']);
}
$title = ucwords(strtolower($replace));
$h1 = ucfirst(strtolower($replace));
?>
我创建了一个页面链接到它进行测试:
http://xuzo.com/link.html
目标测试页面位于:
http://www.xuzo.com/dynamic.php
根据您的实现,在.htaccess.中进行以下更改
是:
重写规则^([^/]+).html?$index.php?q=$1[L]
是:
重写规则^([^/]+).html?$dynamic.php?q=$1[L]