的.htaccess和codeigniter不工作 [英] .htaccess and codeigniter not working

查看:254
本文介绍了的.htaccess和codeigniter不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的雪豹,我有我的本地市场环境,我试图摆脱在URL中的index.php的......这里是我

I am using snow leopard and I have my local environment and I am trying to get rid of the index.php in the url...here is what i have

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

我的配置文件有这个

My config file has this

$config['index_page'] = "";

但是,当我访问的页面不的index.php它不工作

But when i visit the page without index.php it doesnt work

本作品

http://localhost/ci_example/index.php/site

这并不

http://localhost/ci_example/site

我试图按照<一个href="http://stackoverflow.com/questions/1397014/how-do-i-write-a-htaccess-file-to-make-$c$cigniters-url-routing-work">this

也许我需要做的事情与本地的conf文件...但我真的不知道,我不知道如何重新启动Apache的命令行...任何想法

maybe i need to do something with my local conf file...but i really dont know what and i have no idea how to restart apache command line...any ideas

推荐答案

是什么意思时,你说:这是行不通的你是什么意思?你得到一个错误?白色的屏幕? 500错误?

What do you mean when you say "it doesn't work"? Do you get an error? A white screen? A 500 error?

你确定你的httpd.conf文件的的AllowOverride 设置设置为所有?如果不是,它可能不使用.htaccess文件,这意味着该重写规则将不被使用。

Did you make sure your httpd.conf file has the AllowOverride setting set to All? If not, it may not be using your .htaccess file, meaning the rewrite rules won't be used.

这篇关于的.htaccess和codeigniter不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆