L
L
Legal Adviser2020-07-08 20:53:33
Apache HTTP Server
Legal Adviser, 2020-07-08 20:53:33

Where can I read about RewriteCond?

Where can I read about the directives that are specified in .htaccess?
I understand that in particular this line translates to 404 if any word starting with doc occurs afterhttp://sait.ru/

RewriteCond %{REQUEST_URI} ^/doc.*
RewriteRule ^(.*)$ http://%{HTTP_HOST}/404/? [R=301,L]

And then I want to make it so that there is a doc folder in the root of the site in which different pdf documents, etc. will lie, but pages like http://sait.ru/documents/page http://sait.ru/documents/.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-07-09
@Legal2019

make a symbolic link and let yourself open
RewriteCond is not needed here, moreover, the cond is IF, and your THEN is higher
At least the design looks like this

RewriteCond
RewriteCond
RewriteRule

And you have a redirect first then a condition, somehow strange

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question