为什么 codeIgniter 显示在此服务器上未找到请求的 URL? [英] Why codeIgniter show the requested URL was not found on this server?

查看:54
本文介绍了为什么 codeIgniter 显示在此服务器上未找到请求的 URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问.首先,我会告诉我我已经在我的 windows dekstop 上开发了一个使用 codeIgniter 的应用程序.它清晰并完全运行.

I want to ask. First of all, I will tell that I've develop an application use codeIgniter on my windows dekstop. And it clear and run completely.

但是,在我将该项目移至 debian 服务器后,它说:

But, after I move that project to debian server, it said :

The requested URL /index.php/Admin was not found on this server.

我想问,为什么我会得到这样的输出?尽管我使用相同的代码运行了相同的项目.我该如何解决这个问题?

I want to ask, why I got an output like that? Eventhough I ran the same project with the same code. How can I do to fix this issue?

谢谢...

推荐答案

首先启用 mod_rewrite 然后使用以下命令重启 apache2:

First of all enable mod_rewrite then restart apache2 using following commands:

sudo a2enmod rewrite
sudo service apache2 restart

然后使用命令打开 apache conf 文件:

then open apache conf file using command:

sudo gedit /etc/apache2/apache2.conf

如果有注释,请取消注释

uncomment below line if it is commented

AccessFileName .htaccess

然后在 apache2.conf 中找到这些行

then find these lines in apache2.conf

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted

此处将 AllowOverride None 行更改为 AllowOverride All 并保存此文件.

here change the line AllowOverride None to AllowOverride All and save this file.

现在,您的问题已解决.

Now, your issue is resolved.

这篇关于为什么 codeIgniter 显示在此服务器上未找到请求的 URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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