ilahameed
By:
ilahameed

After I reboot server .htaccess stop working. "404 Not Found <br> nginx"

March 3, 2015 700 views

After I reboot server .htaccess stop working, when I try to access any URL defined in my .htaccess it says "404 Not Found <br> nginx"

even mydomian.com/phpmyadmin displays the same error. "404 Not Found <br> nginx"

May be its something with nginx , not sure about it.

Any help is highly appreciated.

Thank you!

1 Answer

Hi!

Since .htaccess worked before, it sounds like you've been using Apache but also have nginx installed which is apparently starting before Apache and reserving port 80 to it.

First of all, stop nginx and start Apache:

sudo systemctl stop nginx.service
sudo systemctl start apache2.service

Or, if you're running an older version of Ubuntu/Debian:

sudo service nginx stop
sudo service apache2 start

Your website should now work fine. Make sure that that is the case, and then disable nginx from starting on boot:

sudo systemctl disable nginx.service

Again, if you're running an older version of Ubuntu/Debian:

sudo update-rc.d nginx disable
Have another answer? Share your knowledge.