2011-07-08 129 views
0

更新:删除XAMPP apache服务器上的index.php?

好的我已经从CI配置中删除了index.php引用,它不再出现在我的url字符串中。

当我进入我的基本URL,它工作正常,并显示我的主页:当我点击我的链接它带我到其他页面我现在得到未找到对象

http://localhost/midas/

但是:

eg我点击博客按钮,带我到:

http://localhost/midas/site/blog

我需要改变我的链接,以及现在的index.php被删除?

Apache的错误日志***

Terminating on signal SIGTERM(15) 
[Tue Jul 12 11:14:31 2011] [warn] pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? 
[Tue Jul 12 11:14:31 2011] [notice] Digest: generating secret for digest authentication ... 
[Tue Jul 12 11:14:31 2011] [notice] Digest: done 
[Tue Jul 12 11:14:33 2011] [notice] Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations 
[Tue Jul 12 11:14:33 2011] [notice] Server built: Oct 18 2010 01:58:12 
[Tue Jul 12 11:14:33 2011] [notice] Parent: Created child process 3856 
[Tue Jul 12 11:14:35 2011] [notice] Digest: generating secret for digest authentication ... 
[Tue Jul 12 11:14:35 2011] [notice] Digest: done 
[Tue Jul 12 11:14:36 2011] [notice] Child 3856: Child process is running 
[Tue Jul 12 11:14:36 2011] [notice] Child 3856: Acquired the start mutex. 
[Tue Jul 12 11:14:36 2011] [notice] Child 3856: Starting 150 worker threads. 
[Tue Jul 12 11:14:36 2011] [notice] Child 3856: Starting thread to listen on port 443. 
[Tue Jul 12 11:14:36 2011] [notice] Child 3856: Starting thread to listen on port 80. 
[Tue Jul 12 13:02:00 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:02:09 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:02:24 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:02:34 2011] [error] [client 127.0.0.1] File does not exist:  C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:03:53 2011] [error] [client 127.0.0.1] File does not exist:  C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:03:56 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:04:52 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:06:13 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site 
[Tue Jul 12 13:07:37 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 
[Tue Jul 12 13:08:05 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/midas/site, referer: http://localhost/midas/ 

我的htaccess:

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ /index.php/$1 [NC,R=301,L] 
+0

您是否正在使用像Kohana,CI等MVC框架? – Chandu

+0

是的,我正在使用Codeigniter – Bob

+0

CI有这样一个美丽的文档。您是否在意检查此页? http://codeigniter.com/user_guide/general/urls.html – Chandu

回答

0

的-f和-d标志应该忽视任何不是一个文件或目录...所以如果你访问的/ site/blog或任何URL实际上存在于请求根目录中,它可能会尝试在那里路由请求而不使用你的重写规则。

这将会是有益的知道,当你尝试这种配置你实际看到的行为,虽然。

0

试试这个

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ /index.php/$1 [NC,R=301,L] 
0

是否有您所使用的重定向规则(R=301)一个特别的原因?

如果您删除的规则的那部分,所以你得到[NC,L]代替,那么你保留的URL隐藏。

我试过在我的WAMP的服务器安装你的规则,它工作正常上我的,你是积极的,mod_rewrite的被解雇你?

+0

哪里是我的httpd.conf – Bob

+0

是什么操作系统您使用 –

+0

的Windows Vista专业版,与XAMPP – Bob