Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

php - Why codeIgniter show the requested URL was not found on this server?

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...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...