10/28/03。 cathayan.org版权所有,保留一切权利。转载请保留此说明。谢绝商业转载。
打开了Fancy URL,这样不但看起来漂亮,而且搜索引擎更容易找到。但2.5b的这个功能有点问题,一会管用,一会不管用。我觉得原因是在$CONF['Self']的设置:fancyurls.config.php这个文件里要求不要加/,而在index.php里又要求加/,这就比较乱了。另外,在 globalfunctions.php中, line 814, 有一个句子是判断这个变量是不是以“.php”结尾的(不知道什么时候会有这种情况),如果是的话就把.php去掉。但实际上那个函数
strrpos()用得有点问题,如果结尾是“.net/.com”等一样会去掉,那就会出问题了。因为它只根据那个“.”做判断。
我的解决方案是在两个文件中给$CONF['Self']全部加上“/”,然后在globalfunctions.php的823行起,把那些加到item/member等词前面的“/”(共7个)全部去掉。然后就彻底OK了。反映到
Bug report上,还没人回。
10/28/03 09:59:00,由
cathayan发表。目录:
下载
5条评论
您好,关于这个问题,我也有点疑问。
在index.php中设置为
$CONF['Self'] = '/ling/';
在fancyurls.config.php 中设置为
$CONF['Self'] = '/ling/';
这个时候,我没有copy .htaccess文件,而是保持其为空。
但是我在apache里面进行了以下设置
Alias /ling “/home/ling/public_html”
(我没有设立 ling这个用户)
<Directory “/home/ling/public_html”>
(省略)
</Directory>
rewriteEngine On
RewriteRule ^/ling/item/([0-9]+)$ /ling/index.php?itemid=$1
始终不行,不知道为什么,按照你的解决方案已经把globalfunctions.php 里面的一些/去掉了
谢谢
http://kreny@dalouis.com kreny 于 02/01/04 14:46:15 发表.
在 http://linux.dalouis.com/blog/下面
测试成功了,以下是我的rewrite
RewriteRule ^/blog/archive/([a-z0-9]+)$ /blog/index.php?archive=$1
RewriteRule ^/blog/archives/([a-z0-9]+)$ /blog/index.php?archivelist=$1
RewriteRule ^/blog/archive/([a-z0-9]+)/([a-z0-9]+)-([a-z0-9]+)$ /blog/index.php?archive=$2-$3\&blogid=$1
RewriteRule ^/blog/item/([0-9a-z]+)$ /blog/index.php?itemid=$1
RewriteRule ^/blog/archivelist/([a-z0-9]+)$ /blog/index.php?archivelist=$1
RewriteRule ^/blog/blog/([0-9a-z]+)$ /blog/index.php?blog=$1
http://kreny@dalouis.com kreny 于 02/01/04 18:56:03 发表.
补充一下
应该是
RewriteRule ^/blog/archive/([a-z0-9]+)$ /blog/index.php?archive=$1
RewriteRule ^/blog/archives/([a-z0-9]+)$ /blog/index.php?archivelist=$1
RewriteRule ^/blog/archive/([a-z0-9]+)/([a-z0-9]+)-([a-z0-9]+)$ /blog/index.php?archive=$2-$3\&blogid=$1
RewriteRule ^/blog/archive/([a-z0-9]+)/([a-z0-9]+)-([a-z0-9]+)-([a-z0-9]+)$ /blog/index.php?archive=$2-$3-$4\&blogid=$1
RewriteRule ^/blog/item/([0-9a-z]+)$ /blog/index.php?itemid=$1
RewriteRule ^/blog/archivelist/([a-z0-9]+)$ /blog/index.php?archivelist=$1
RewriteRule ^/blog/blog/([0-9a-z]+)$ /blog/index.php?blog=$1
RewriteRule ^/blog/([a-z0-9]+)/([a-z0-9]+)/([a-z0-9]+)/([a-z0-9]+)$ /blog/index.php?$1=$2\&$3=$4
http://kreny@dalouis.com kreny 于 02/01/04 19:05:08 发表.
I am watching and will delete all spam.