Blog on 27th Floor
主页 随便 电脑 电影 社会 阅读 下载 本站 存档
主页 随便 电脑 电影 社会 阅读 下载 本站 存档

打开了Fancy URL

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 发表. 

不好意思,时间长了,几乎看不懂了。我这里只是用人家的虚拟主机,对Apache的设置都不知道,更没有自己的设置,碰巧摸索出来而已。

http://blog.cathayan.org/member/1 cathayan 于 02/01/04 19:20:14 发表. 

阿~没事儿没事儿,反正搞定了~ 嘿嘿嘿。
就是还有一个插件想问一下,就是一篇文章太长,怎么样取其前面一部分阿~ 然后再点击全文进入....

http://kreny@dalouis.com kreny 于 02/01/04 22:50:03 发表. 


这篇文章已经关闭,不能添加评论和投票
I am watching and will delete all spam.

我的E-Mail


Copy&Paste Exchange

访问CPeX Group

订阅Feed

订阅Feedburner
Feedsky订阅
本站订阅

请登录

导航

cathayan.org Web

最新贴

RIME 小狼毫/鼠须管的极点及五笔拼音配置
Software that rocks or sucks less
一棵热带的树换新叶的过程
几个有用的Vim招术
论语七 述而
Nomacs 图像浏览器
Windows 文件校验
Windows 10 文件批量命名简单方法
Windows 10 文件删除高级操作
本站也算是有响应式设计了

最新评论

Powered by

Powered by Nucleus CMS

版权声明

Creative Commons License
Blog on 27th floor by Cathayan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Powered by Nucleus CMS v3.71. Best view with Mozilla browsers.