Site icon Hip-Hop Website Design and Development

htaccess rules not applied?

So here is the full .htaccess file, with code added to redirect all urls/pages to the only accessible page of the site, except content, includes and admin ones:

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


# BEGIN Custom

<IfModule mod_rewrite.c>
## Redirect all except given page/url to given website address
## src: https://stackoverflow.com/questions/54176472/htaccess-redirect-all-links-except-base-url
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !^/page-accessible/
RewriteCond %{REQUEST_URI} !^/wp-content/
RewriteCond %{REQUEST_URI} !^/wp-admin/
RewriteCond %{REQUEST_URI} !^/wp-includes/
RewriteRule .* https://molhokwai-tests.cloudaccess.host/page-accessible/ [L,R=301]
</IfModule>

# END Custom

But it only redirects root.

Can someone please explain? Is there a better way to do this?

Thank you