Report this

What is the reason for this report?

404 Not Found Error

Posted on March 31, 2018

I installed LAMP stack and followed the following tutorials to make my droplet ready I installed Wordpress on main domain and PHP script on subdomain! Wordpress is working well but when i open the subdomain index.php file load well but when i click on Login/Signup Page it gives me “Not Found The requested URL /app/login was not found on this server.” ! Same script works fine on shared hosting and now i want to switch to VPS but encounter this error! I contacted the script developer he said it’s due to .htaccess file not working or executed! System is using the default settiings and ignore the .htaccess file placed in subdomain! Please help me :')

Site Url: alphafire.me subdomain: alphafire.me/app

Tutorials Followed: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04 https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-16-04 https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lamp-on-ubuntu-16-04



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

If your index.php file is loading properly on your php script but other pages are not this likely indicates an issue with your url redirects. On apache these are likely to be located in an .htaccess file in your web root.

In order for the redirects included in the .htaccess file to be used by Apache to route requests you need to ensure that your virtualhost configuration for this site uses:

AllowOverride All

rather than the default

AllowOverride None

This tells apache that it can use directives in the .htaccess file to override the default settings.

I just struggled with this for hours. Turns out my entire contents of var/www/html was placed inside an html.old folder instead of just html. that solved it

This answer on Stackoverflow solved the issue in my case:

"In case you are on Ubuntu, edit the file /etc/apache2/apache2.conf (here we have an example of /var/www):

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

and change it to;

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

then,

sudo service apache2 restart

You may need to also do sudo a2enmod rewrite to enable module rewrite."

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.