Why codeIgniter show the requested URL was not found on this server?(为什么 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么 codeIgniter 显示在此服务器上未找到请求的 URL?


基础教程推荐
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何替换eregi() 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01