Hex 发表于 2011-11-4 15:56 static/image/common/back.gif
带 index.php 能访问有什么不好吗。。。。
如果不想 index.php 能访问,可以在规则里删除那个 index.php...
是把.htaccess文件改成这样:
RewriteEngine on
RewriteBase /future/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(images|robots\.txt) //我把这里的index.php去掉了。
RewriteRule ^(.*)$ index.php/$1 //这里去掉 index.php就无法访问啦
求指教我新手!!
nananjoy 发表于 2011-11-5 11:53 static/image/common/back.gif
是把.htaccess文件改成这样:
RewriteEngine on
RewriteBase /future/
你必须按照我的写法,才可以去掉 index.php。
你现在这是另一种写法。
rewrite 规则有很多写法,条条大路通罗马,建议你还是系统学习一下 URL Rewrite 规则比较好。
你好:
我本地访问地址是http://127.0.0.1/CodeIgniter_2.1.0/index.php
.htaccess里面 是下面 那样吗???为什么不行呢。。。
RewriteEngine on
RewriteCond $1 !^(index\\.php|images|robots\\.txt)
RewriteRule ^(.*)$ /CodeIgniter_2.1.0/index.php/$1
{:1_1:}谢楼主
晕,在Win7里运行Apache,不能建立.htaccess文件呀,老是提示要输入文件名...
弄成了.htacess,可所有的文件都不能访问了,500错误,还是老实得改了回来...
我是用的WAMPServer
RewriteEngine on
RewriteCond $1 !^(index\\.php|images|robots\\.txt)
RewriteRule ^(.*)$ /index.php/$1
老大,转义符只要一个就行了,不能是双斜线啊,双斜线报500错误!
kissgxd 发表于 2012-5-5 10:47 static/image/common/back.gif
老大,转义符只要一个就行了,不能是双斜线啊,双斜线报500错误!
呵呵,已修复,这是由于 Discuz! 论坛转义造成的混乱。
鼓捣半天终于弄好了 贴下我的吧
RewriteEngine on
RewriteCond $1 !^(index\.php|images|js|css|uploads|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1
样式不乱了,index.php也去掉了 感觉不错:lol