[apache] 404 Not Found The requested URL was not found on this server

I'm having small troubles and was wondering if someone can help me over the hump. I pulled a copy of a website down from Hostgator and I'm trying to set it up on my local machine using WAMP but, I keep getting an error when trying to access the site. Here is what I have tried..I went to Apaches httpd.conf file and uncommented the # from LoadModule rewrite_module modules/mod_rewrite.so. Also I have changed the AllowOverride None to All. With that said, Im not sure what else to look for. Please note within my application my httaccess files do not have a (.) in front of them (.htaccess). I'm not sure if that is worth noting or not. Any ideas as to what I need to do to access my site? When I access the application I do see a cached version (white screen), but when I click the link to log in I see the 404 Not Found.

This question is related to apache cakephp mod-rewrite cakephp-1.3 wamp

The answer is


If your .htaccess file is ok and the problem persist try to make the AllowOverride directive enabled in your httpd.conf. If the AllowOverride directive is set to None in your Apache httpd.config file, then .htaccess files are completely ignored. Example of enabled AllowOverride directive in httpd.config:

 <Directory />
    Options FollowSymLinks
    **AllowOverride All**
 </Directory>

Therefor restart your server.


In Ubuntu I did not found httpd.conf, It may not exit longer now. Edit in apache2.conf file working for me.

cd /etc/apache2
sudo gedit apache2.conf

Here in apache2.conf change

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

to

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

Just solved this problem! I know the question is quite old, but I just had this same problem and none of the answers above helped to solve it.

Assuming the actual domain name you want to use is specified in your c:\windows\System32\drivers\etc\hosts and your configurations in apache\conf\httpd.conf and apache\conf\extra\httpd-vhots.conf are right, your problem might be the same as mine:

In Apache's htdocs directory I had a shortcut linking to the actual project I wanted to see in the browser. It turns out, Apache doesn't understand shortcuts. My solution was to create a proper symlink:

In windows, and within the httdocs directory, I ran this command in the terminal:

mklink /d ple <your project directory with index.html> 

This created a proper symlink in the httpdocs directory. After restarting the Apache service and then reloading the page, I was able to see my website up :)


For saving a file as .htaccess, when using windows, you have to open notepad and then saveas .htaccess as windows does not create files starting with a dot. That should get your .htaccess working and it'll clear up the issue.

By the way, in order to receive specific error messages set Configure::write('debug', 0); to '2' in app/config/core.php for development purposes.


In my case (running the server locally on windows) I needed to clean the cache after changing the httpd.conf file.

\modules\apache\bin> ./htcacheclean.exe -t

In wamp/alias/mySite.conf, be careful to add a slash "/" at the end of the alias' adress :

Replace :

Alias /mySite/ "D:/Work/Web/mySite/www"

By :

Alias /mySite/ "D:/Work/Web/mySite/www/"

Or the index.php is not read correctly.


change this

Include conf/extra/httpd-vhosts.conf

to

#Include conf/extra/httpd-vhosts.conf

and restart all services


For me, using OS X Catalina: Changing from AllowOverride None to AllowOverride All is the one that works.

httpd.conf is located on /etc/apache2/httpd.conf.

Env: PHP7. MySQL8.


Examples related to apache

Enable PHP Apache2 Switch php versions on commandline ubuntu 16.04 Laravel: PDOException: could not find driver How to deploy a React App on Apache web server Apache POI error loading XSSFWorkbook class How to enable directory listing in apache web server Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details How to enable php7 module in apache? java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing while starting Apache server on my computer

Examples related to cakephp

SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' using CakePHP CakePHP 3.0 installation: intl extension missing from system How to check not in array element 404 Not Found The requested URL was not found on this server What is /var/www/html? Request exceeded the limit of 10 internal redirects due to probable configuration error how we add or remove readonly attribute from textbox on clicking radion button in cakephp using jquery? PHP Fatal error: Class 'PDO' not found Undefined variable: $_SESSION CentOS: Enabling GD Support in PHP Installation

Examples related to mod-rewrite

Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04 Forbidden You don't have permission to access / on this server Htaccess: add/remove trailing slash from URL Permission denied: /var/www/abc/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable? 404 Not Found The requested URL was not found on this server Redirect all to index.php using htaccess .htaccess not working on localhost with XAMPP URL rewriting with PHP No input file specified htaccess redirect to https://www

Examples related to cakephp-1.3

404 Not Found The requested URL was not found on this server TypeError: $(...).on is not a function Set Response Status Code

Examples related to wamp

WAMP won't turn green. And the VCRUNTIME140.dll error cURL error 60: SSL certificate: unable to get local issuer certificate How to enable local network users to access my WAMP sites? WampServer: php-win.exe The program can't start because MSVCR110.dll is missing Project Links do not work on Wamp Server ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it Apache won't start in wamp How to send email from localhost WAMP Server to send email Gmail Hotmail or so forth? Fatal error: Call to undefined function sqlsrv_connect() WampServer orange icon