- You are using a Linux distro + You are using Xampp as your LAMP stack
If you are new to using MVC frameworks, for instance DooPHP, AlloyFramework or ZendFramework, it might be that you have been bumping your head against the wall when you browser outputs the following error message: “Object not found! The requested URL was not found on this server..etc”.
Lets take an example:
You can access http://locahost/
..but you cannot access http://localhost/index
..although http://localhost/index.php works totally fine.
Solution To This Issue
The problem here originates from your Apache configs, namely the httpd.conf
1) Open your httpd.conf
==> This would be located in /opt/lampp/etc/httpd.conf (assuming your installation folder is opt)
2) Search for AllowOverride – Is yours like: “AllowOverride None“? If yes, change None to All as below:
#Deny from all
A) If this does not work, it might be that you have changed it at the wrong place, since there are TWO such AllowOverride in httpd.conf. That 2nd one looks as shown below:
Allow from all
B) If despite the above, you still have issue, the next culprit is your httpd-vhosts.conf found at /opt/lampp/etc/extra/httpd-vhosts.conf
What’s wrong in there you might wonder? It means that you have another similar AllowOverride block as shown in A. The solution here is to either keep the one from your httpd.conf or the one from the httpd-vhosts.conf
Either one you choose, there should only be one instance of it + you need the AllowOverride to be ALL, that is: AllowOverride All
C) Now, if all the above still does not work, my last bet would be that you do not have the Apache’s mod_rewrite module enabled.
Don’t panic, this is very easy to enable. Open your httpd.conf again and search for the line which has ‘mod_rewrite‘, typically it will have the extension .so under linux. You can enabled it by removing the hash, (#), which starts the line, see below:
WRONG: #LoadModule rewrite_module modules/mod_rewrite.so
GOOD: LoadModule rewrite_module modules/mod_rewrite.so
NOTE: You need to restart your Xampp server after any of the above changes. Happy MVC-ing geekos!
Why Have I Not Started By C
=> Simply because nowadays Xampp enabled mod_rewrite in a default installation.. Linux and the OpenSource sphere makes the world a better place to code and enjoy some good software.. 🙂
If you have any other symptoms or you want to add something, feel free to use the comment form below..