@
@
@cotang2016-04-29 00:20:16
Apache HTTP Server
@cotang, 2016-04-29 00:20:16

Wordpress - all pages except the main one are displayed according to the 404.php template. How to fix?

Hello.
I am now pulling the layout on the Wordpress engine locally on OpenServer. All of a sudden, all pages except the main page were rendered using the 404.php template. I attribute this to the fact that I changed the url settings in the process - I did not initially change them on the CNC, and when I did, this problem apparently arose. I googled, on the Internet they suggest to solve this problem by changing the contents of the .htaccess file and activating the mod_rewrite configuration of the Apache server.
Just changing .htaccess didn't help.
In Apache, the line "LoadModule rewrite_module modules/mod_rewrite.so" is uncommented, and in
AllowOverride All
...
The content of .htaccess is now:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Tell me, do I understand my problem with pages correctly, am I doing the right thing, and how do I actually deal with the problem? I haven’t uploaded it to hosting yet, because. I didn't fully understand what was going on here.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
W
WP Panda, 2016-04-29
@wppanda5

Restore the CNC

C
cotang, 2016-04-29
@cotang

Initially, the permalink settings were "simple" .../?p=123, then I changed to "post name" .../sample-post/, and a 404 error occurred. Now I tried to return to "simple", and that's it looks great as before. And for pages, it doesn't like anything other than .../?page_id=34.
But I would still like to display the title of the page / post for greater clarity.
Index.php is present.
Simply resaving links doesn't help.

G
Grayni Web, 2017-07-23
@Grayni

"<"Directory path to project">"
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
"<"/Directory">"
Add to apache2.conf

I
Ivan Kozlov, 2016-04-29
@trampick

this is standard htacces wordpress.

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

What do you have in settings "Settings > permalinks" in the admin panel? Is there an index.php file in the template?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question