is it possible to do this
RewriteRule robots.txt dirname(%{DOCUMENT_ROOT})/robots.php [L]
i need get parent folder of D开发者_Go百科OCUMENT_ROOT
You can't create a rewrite rule pointing to a target outside the document root in the context of a .htaccess
file, so even if it were possible to find out the parent directory (which I doubt), it won't work.
The only way around this that I know is creating a symbolic link that points to the correct robots.php
file. It may even be possible to create a relative symbolic link pointing to ../robots.php
, I'm not sure.
精彩评论