A
A
antpv2018-03-29 17:13:16
linux
antpv, 2018-03-29 17:13:16

How to fix 404 Not Found if exactly the same script works properly on another server?

On a new VPS under Ubuntu 16.04, I installed Apache, MySQL + PhpMyAdmin, PHP according to the instructions - DigitalOcean .
I uploaded the script to the site, by the way, I immediately gave the error You don't have permission to access / on this server. After setting the rights to 777 on www, it worked, but the following problem arose:
When you go to any page, you can make sure that it gives 404 Not Found. Perhaps the problem is in .htaccess, but on the other hand, on the hosting and on another server, the script worked right away, at least the pages were accessible with the same .htaccess. Help me please.
.htaccess code:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]

# RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan Fedoseev, 2018-03-29
@antpv

AllowOverride None
find it in the apache config, change it to
AllowOverride All
, be glad that everything worked, read the documentation.

B
Boris Korobkov, 2018-03-29
@BorisKorobkov

1. Uncomment the line LoadModule rewrite_module modules/mod_rewrite.so
2. Restart Apache.
3. ...
4. Profit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question