S
S
sexleke2019-01-10 15:38:27
htaccess
sexleke, 2019-01-10 15:38:27

How to make htaccess redirect to a file and not to a folder?

Made a cnc redirect from /test.html to /test
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.html - f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]
But it doesn't work if there is a folder with the same name as the html file!
will open the folder and I need to open the file) how can I do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-01-10
@sexleke

AddDirectorySlash Off

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question