免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2313 | 回复: 5
打印 上一主题 下一主题

[Web] rewrite问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-01 17:35 |只看该作者 |倒序浏览
我的.htaccess文件内容:

#<IfModule mod_url.c>
#CheckURL Off
#</ifModule>
RewriteEngine On

#RewriteBase /blog/

RewriteCond %{ENV:REDIRECT_SURI} !^$
RewriteRule (.*) - [L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [L]
#RewriteRule ^$ blog/index.php [L]

#RewriteRule /* blog/index.php [L]
RewriteRule ^[[:alnum:]]+/*$ blog/index.php [L]
#RewriteRule /*$         blog/index.php [L]


RewriteRule ^[[:alnum:]]+/+[0-9]+$ blog/item.php [L]
RewriteRule ^favicon\.ico$ blog/favicon.ico.php [L]
RewriteRule ^[[:alnum:]]+/+favicon\.ico$ blog/favicon.ico.php [L]
RewriteRule ^index\.gif$ blog/index.gif.php [L]
RewriteRule ^[[:alnum:]]+/+index\.gif$ blog/index.gif.php [L]
RewriteCond %{QUERY_STRING} (^|&)pl=([0-9]+)
RewriteRule ^([[:alnum:]]+)/+index\.php$ $1/%2 [NE,L]
RewriteRule ^[[:alnum:]]+/+index\.php$ blog/index.php [L]
RewriteRule ^[[:alnum:]]+/+index\.xml$ blog/rss/index.php [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule !^(blog|cache)/ - [L]
RewriteRule ^[[:alnum:]]+/+(thumbnail)/([0-9]+/.+) cache/$1/$2 [L]

RewriteRule ^[[:alnum:]]+/+(entry|attachment|category|keylog|tag|search|plugin)/? blog/$1/index.php [L]


RewriteRule ^[[:alnum:]]+/+(.+)/[0-9]+$ blog/$1/item.php [L]
RewriteRule ^[[:alnum:]]+/+(.+)$ blog/$1/index.php [E=SURI:1,L]

#end .htaccess


其中最后一句中RewriteRule ^[[:alnum:]]+/+(.+)$ blog/$1/index.php [E=SURI:1,L]
E=SURI:1  有什么作用啊?为什么我把它删掉就会报错呢??但好像又没什么作用?
如:RewriteRule ^[[:alnum:]]+/+(.+)$ blog/$1/index.php [L]
然后就会报错:Internal Server Error
很不明白原因,我只知道其作用是环境变量,删掉为什么会报服务器错误呢?
请各位指点,谢谢先~~~

论坛徽章:
0
2 [报告]
发表于 2007-11-02 08:43 |只看该作者
怎么老大们都不帮我解答的~~~~

论坛徽章:
0
3 [报告]
发表于 2007-11-02 14:58 |只看该作者
是不是blog或者这个目录的子目录下使用了SURI这个环境变量??

但是:1 不知道什么作用!!

帮助文档里面是RewriteEngine on
RewriteRule   ^(.*)/S=([^/]+)/(.*)    $1/$3 [E=STATUS: $2]

论坛徽章:
0
4 [报告]
发表于 2007-11-02 15:03 |只看该作者
blog或者这个目录的子目录下没有使用到SURI这个环境变量

我grep -lri 'SURI' * 没找到有

而且我在正常时的文件开头我加了句:
echo time();exit;

论坛徽章:
0
5 [报告]
发表于 2007-11-03 18:43 |只看该作者
同问啊~望高手解答一下!

论坛徽章:
0
6 [报告]
发表于 2007-11-05 11:51 |只看该作者
好烦啊,没人解答下,到现在还不明白啊~~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP