我最近在我的网页上添加了一个点击计数器,以查看人们来自哪些域名。由于我有两个指向相同IP的域,我最近获得了这些域。
所有请求都转到我的index.php文件,该文件确定如何显示页面。我有这样设置,因为我计划有多个页面,如用户页面或论坛帖子,并且不能有多个文件夹。 .htaccess设置如下:
>>> import pandas as pd
>>> forward_map = {'fun': 1, 'work': 2}
>>> reverse_map = {v: k for k, v in forward_map.iteritems()}
>>> df = pd.DataFrame(
{'activity': ['work', 'work', 'fun', 'fun', 'work'],
'detail': ['reports', 'coding', 'hiking', 'games', 'secret games']})
>>> df
activity detail
0 work reports
1 work coding
2 fun hiking
3 fun games
4 work secret games
>>> df['activity'] = [forward_map[i] for i in df['activity']]
>>> df
activity detail
0 2 reports
1 2 coding
2 1 hiking
3 1 games
4 2 secret games
>>> df['activity'] = [reverse_map[i] for i in df['activity']]
>>> df
activity detail
0 work reports
1 work coding
2 fun hiking
3 fun games
4 work secret games
在我的index.php开头,我有:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/phpmyadmin/?$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php [NC,L,QSA]
然而,图像算作命中。如果我要去domain.com/img/img.png 这将是一个打击。我怎么能阻止它这样做? (我有一些javascript,这会使粒子从顶部“掉落”。这导致点击次数每小时增加1000次)