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
.

- 462
- 10
- 22

- 621
- 2
- 7
- 15
-
1What URL are you trying to access and what file do you want it to pull up? The dot in `.htaccess` is required http://smartwebdeveloper.com/apache/htaccess-problems – Sarah Kemp Sep 17 '13 at 14:53
-
I am trying to access my login page Slic/users/login. I want it to pull up the login view. – SkillSet Sep 17 '13 at 15:01
-
Ok I got it. I had to go and rename all the .htaccess files. The 1st one being in www\Slic\.htaccess. The next one was in www\Slic\app\.htaccess. The last was in www\Slic\app\webroot\.htaccess – SkillSet Sep 17 '13 at 15:11
-
Thanks for that article you posted!! It got me over the hump!! – SkillSet Sep 17 '13 at 15:11
-
Possible duplicate of [The requested URL /about was not found on this server](https://stackoverflow.com/questions/13149418/the-requested-url-about-was-not-found-on-this-server) – Damjan Pavlica Jul 26 '18 at 19:07
12 Answers
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>

- 3,850
- 3
- 24
- 38
-
10This worked for me, but after making the change, don't forget execute: sudo a2enmod rewrite. And: sudo systemctl restart apache2. – Fabrizio Valencia Jun 23 '21 at 03:26
-
1
-
This worked for me, thanks! Doing the sudo a2enmod rewrite. And: sudo systemctl restart apache2 after it, obviously – jamc92 Feb 09 '23 at 19:57
-
Thanks this worked for me also. After this run below commands \n **sudo a2enmod rewrite** And **sudo systemctl restart apache2** – Sunilspr7 May 11 '23 at 09:15
In httpd.conf file you need to remove #
#LoadModule rewrite_module modules/mod_rewrite.so
after removing # line will look like this:
LoadModule rewrite_module modules/mod_rewrite.so
I am sure your issue will be solved...

- 4,512
- 8
- 25
- 37

- 1,120
- 1
- 17
- 23
-
4On Ubuntu the main Apache configuration file is actually `apache2.conf` . At directory: `/etc/apache2/` – Vy Do Nov 19 '14 at 07:07
-
@DoNhuVy in ubuntu, add `LoadModule rewrite_module modules/mod_rewrite.so` to apache.conf? – SparkAndShine Apr 26 '15 at 17:06
-
@QiankunSU , I think in this case: `apache2.conf`. Sorry, current I don't use Ubuntu. – Vy Do Apr 27 '15 at 01:46
-
1My MAMP have that uncomment already, and I still see that error `The requested URL /login was not found on this server.` – code-8 Oct 29 '16 at 22:09
-
I am new to server part. I cannot find httpd.conf file on ubuntu. Where to add that line? – bhaskar Mar 09 '20 at 14:45
-
change this
Include conf/extra/httpd-vhosts.conf
to
#Include conf/extra/httpd-vhosts.conf
and restart all services

- 149
- 1
- 3
-
1
-
This is done in apache/conf/httpd.conf but this didn't work for me. – ManuAlvarado22 Mar 31 '21 at 15:45
i was spend lots of time in this after then i found ...solution
first -
sudo a2enmod rewrite
sudo systemctl restart apache2
this line depends on your apache2 version you found on your console copy and past ...
sudo nano /etc/apache2/sites-available/000-default.conf
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

- 409
- 4
- 5
In apache version: 2.4.41
First, enable the apache rewrite module:
sudo a2enmod rewrite
you need to change in apache2.conf
no need to change in sites-available
sudo gedit /etc/apache2/apache2.conf
Original
<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>
And restart apache2
sudo service apache2 restart

- 13,720
- 5
- 57
- 57
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.

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

- 11,560
- 2
- 43
- 44
-
http://stackoverflow.com/questions/24497749/httpd-conf-allowoverride-all – Badr Bellaj Oct 29 '16 at 22:39
-
I tried your suggestion. I still get `The requested URL /login was not found on this server. ` – code-8 Oct 29 '16 at 22:41
-
-
I did. And I still see that error and I declare that route on my application already. – code-8 Oct 29 '16 at 23:27
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.

- 152
- 1
- 9
-
What I did to rename my .htaccess was open my command prompt and execute the following. Rename c:\wamp\www\app\htaccess.txt .htaccess – SkillSet Sep 17 '13 at 16:33
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 :)

- 11
- 1
- 2
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.

- 1,508
- 16
- 21
https://create-react-app.dev/docs/deployment/
If you’re using Apache HTTP Server, you need to create a .htaccess file in the public folder that looks like this:
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
It will get copied to the build folder when you run npm run build.

- 807
- 1
- 11
- 19
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

- 1
- 1