用户
 找回密码
 入住 CI 中国社区
搜索
查看: 5447|回复: 11
收起左侧

[已解决] 关于万网的rewirte的问题

[复制链接]
发表于 2010-4-13 13:57:45 | 显示全部楼层 |阅读模式
以前我用的是国外的免费空间,程序上传之后一切正常,包括.htaccess重写。
为了追求速度我买了万网的M3空间(unix主机 操作系统freeBSD).前天才通过了ICP的备案。
昨天上传程序之后,发现我点击所有的页面都会自动跳转到首页。也就是说其他的页面访问不了。
为了找到问题,我开始将.htaccess文件删除,之后,我用代index.php?的方式访问,是可以正常打开对应的页面的。
但是我一加上我的.htaccess文件之后,又是所有的链接跳转到了首页。

以下是我.htaccess的内容
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|css|js|system/application/plugins/Edit|system/application/plugins/uploadfile|uploads/books|uploads/jeans_imgs|uploads/thumb|uploads/jeansdetail/small|uploads/jeansdetail/large)
RewriteRule ^(.*)$ index.php/$1 [L]

以下是我的网站:
http://www.leonejans.com

不知有哪位CI Lover也是使用万网的M3帮我一下。谢谢。
发表于 2010-6-6 01:05:10 | 显示全部楼层
我想知道楼主的 url是怎么处理的
 楼主| 发表于 2010-4-13 14:15:12 | 显示全部楼层
自己顶一下
 楼主| 发表于 2010-4-13 14:41:49 | 显示全部楼层
config文件内容:
$config['base_url']        = "http://www.leonjeans.com/";
$config['index_page'] = "";
$config['uri_protocol']        = "AUTO";
$config['url_suffix'] = ".html";
$config['language']        = "english";
其它的内容没有改动
 楼主| 发表于 2010-4-13 14:42:39 | 显示全部楼层
router.php内容:
$route['default_controller'] = "leonindex";
$route['scaffolding_trigger'] = "";
$route['leonindex/:any']="leonindex/index";
$route['home/:any']="home/index";
$route['jeans/:any']="jeans/index";
$route['brands/:any']="brands/index";
$route['search/:any']="search/index";
$route['category/:any']="category/index";
$route['articles/:any']="articles/index";
$route['storedesc/:any']="storedesc/index";
$route['showarticles/:any']="showarticles/index";
$route['getclassjeans/:any']="getclassjeans/index";
$route['special/:any']="special/index";
$route['news/:any']="news/index";
$route['newjeans/:any']="newjeans/index";
 楼主| 发表于 2010-4-13 18:48:55 | 显示全部楼层
难道没人知道问题的原因吗?
发表于 2010-4-13 19:41:44 | 显示全部楼层
RewriteRule ^(.*)$ index.php/$1 [L]
是不是应该为
RewriteRule ^(.*)$ /index.php/$1 [L]
 楼主| 发表于 2010-4-13 20:28:56 | 显示全部楼层
RewriteRule ^(.*)$ index.php/$1 [L]
是不是应该为
RewriteRule ^(.*)$ /index.php/$1 [L]
zycbob 发表于 2010-4-13 19:41



    我试过的没有用,非常奇怪。我这样写的内容在本机上都没问题的。
 楼主| 发表于 2010-4-13 21:41:25 | 显示全部楼层
被这个问题搞的很烦了,快来救救我呀。
 楼主| 发表于 2010-4-22 12:44:41 | 显示全部楼层
自己解决了,发出来给大家参考;
将config.php中的
$config['uri_protocol']        = "AUTO";
改为:
$config['uri_protocol']        = "REQUEST_URI";
之后.htaccess文件开始生效
发表于 2010-4-22 13:45:46 | 显示全部楼层
uri_protocol 这个东西大家应该好好理解一下,很有奥妙。

本版积分规则