开发者

htaccess document_root dirname

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜