Pergunta

I'm unsure whether the following is correct considering I can't find a web example that targets a file inside a directory.

<FilesMatch "/out/index.php$">
Header set X-Robots-Tag "noindex, nofollow"
</FilesMatch>

is it ok that way or:

<FilesMatch "\out\index.php$">
Header set X-Robots-Tag "noindex, nofollow"
</FilesMatch>
Foi útil?

Solução

First one is the right one as Apache like Unix systems uses forward slash for paths.

So the right one is:

<FilesMatch "/out/index\.php$">
    Header set X-Robots-Tag "noindex, nofollow"
</FilesMatch>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top