为什么codeIgniter在此服务器上显示请求的URL?

编程入门 行业动态 更新时间:2024-10-19 11:44:47
本文介绍了为什么codeIgniter在此服务器上显示请求的URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我想问一下首先,我会告诉我,我已经开发了一个应用程序使用codeIgniter在我的Windows dekstop。并且它完全清除并运行完毕。

但是,在将该项目移动到debian服务器之后,它说:

在此服务器上找不到请求的URL /index.php/Admin。

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

谢谢...

解决方案

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

sudo a2enmod rewrite sudo service apache2 restart

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

sudo gedit /etc/apache2/apache2.conf

取消评论下方的评论

AccessFileName .htaccess

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

< Directory / var / www /> 选项索引FollowSymLinks AllowOverride无要求全部授予

这里更改行AllowOverride None to AllowOverride All并保存此文件。

现在,您的问题已解决。

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.

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?

Thanks...

解决方案

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

sudo a2enmod rewrite sudo service apache2 restart

then open apache conf file using command:

sudo gedit /etc/apache2/apache2.conf

uncomment below line if it is commented

AccessFileName .htaccess

then find these lines in apache2.conf

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

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

Now, your issue is resolved.

更多推荐

为什么codeIgniter在此服务器上显示请求的URL?

本文发布于:2023-10-31 16:01:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546578.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:在此   器上   codeIgniter   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!