htaccess – Permalinks not working on debian with OVH

Question

How to fix 404 errors from permalinks ?

I tried to change https://website/?page_id=690
to https://website/salle-de-bain on my website.

So I go on settings > permalinks and do a /%postname%/ structure.

Now when I goes on [https://website/salle-de-bain][1] from the page I have created I got an error (404):

Not Found 404
The requested URL was not found on this server.

The URL from the page editor is https://website/salle-de-bain so what happend ?

DIAGNOSTIC :

  1. I have Verified that the “rewrite_module” is enabled in Apache
    apache2ctl -M | grep rewrite

return : rewrite_module (shared)

  1. I Have verified the configurations files on /etc/apache2/sites-available
    and added theses lines on default-ssl.conf :
    <Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory>
  2. I have also checked the permissions of the WordPress files and directories :

sudo find /var/www/html -type d -exec chmod 755 {} \; && sudo find /var/www/html -type f -exec chmod 644 {} \;

  1. I have checked .htaccess and put a rule to see if it’s working :

cat /var/www/html/.htaccess
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> RewriteRule ^test$ index.php

I also added Options +FollowSymlinks RewriteEngine On AllowOverride All

I have checked the URL in wordpress to be sure that it’s matches the .htacess rules (test) and it’s still a 404 and no redirect.

  • I have cleared the cache in wordpress
  • I have désactivates every Pluging’s on wordpress
  • I also Checked the Apache errors log for any relevant error messages, but there is NOTHING (I have fixed warnings).

I’m completely clueless, I don’t know how to fix it.
Thank you for your help guys, I really want to know what happends here.

This website is for my brother who is creating who is creating his business

Thank you in advance,

Note : I am on a virtual server on OVH. (vps).

0
P W 1 year 2023-03-05T18:16:24-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse