关于万网的rewirte的问题
以前我用的是国外的免费空间,程序上传之后一切正常,包括.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
以下是我的网站:
http://www.leonejans.com
不知有哪位CI Lover也是使用万网的M3帮我一下。谢谢。 我想知道楼主的 url是怎么处理的 自己顶一下 config文件内容:
$config['base_url'] = "http://www.leonjeans.com/";
$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";
$config['url_suffix'] = ".html";
$config['language'] = "english";
其它的内容没有改动 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"; 难道没人知道问题的原因吗? RewriteRule ^(.*)$ index.php/$1
是不是应该为
RewriteRule ^(.*)$ /index.php/$1 RewriteRule ^(.*)$ index.php/$1
是不是应该为
RewriteRule ^(.*)$ /index.php/$1
zycbob 发表于 2010-4-13 19:41 http://codeigniter.org.cn/forums/images/common/back.gif
我试过的没有用,非常奇怪。我这样写的内容在本机上都没问题的。 被这个问题搞的很烦了,快来救救我呀。 自己解决了,发出来给大家参考;
将config.php中的
$config['uri_protocol'] = "AUTO";
改为:
$config['uri_protocol'] = "REQUEST_URI";
之后.htaccess文件开始生效 uri_protocol 这个东西大家应该好好理解一下,很有奥妙。
页:
[1]
2