我想在我的网址末尾添加唯一哈希
示例如果url是www.site.com/page.html我喜欢每次用户访问时生成
www.site.com/page.html?asdao238rsv
www.site.com/page.html?2498yu234bj
www.site.com/page.html?sdn3i9sfkl9
我找到一个.htaccess,它在url之后添加一个静态文本,但我喜欢独特的文本
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} !(^|&)ThisWillBeAddedAfterUrl g(&|$) [NC]
RewriteRule . %{REQUEST_URI}?ThisWillBeAddedAfterUrl [L,QSA,R=302,NE]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
答案 0 :(得分:0)
您可以添加%{TIME}
代替静态字符串,如下所示:
RewriteRule ^(.*)?$ $1.php?%{TIME} [L,QSA]