B
B
bro18072020-07-14 21:48:25
Apache HTTP Server
bro1807, 2020-07-14 21:48:25

Redirection not working on folders?

For CNC there is a redirect to index.php

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

But when you enter a query that matches the name of the folder, the redirect does not work.
For example, when you enter site.ru/css, it displays a list of files from the css folder. Changing the access rights of this folder does not help, instead of a list of files, the inscription "access denied" appears.
At the same time, everything works fine with other requests.
Can I fix this, or will I have to deny access to all folders and make links other than folder names?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-07-14
@bro1807

Remove RewriteCond %{REQUEST_FILENAME} !-d
And may need to be addedDirectorySlash off

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question