문제

is it possible to do this

RewriteRule robots.txt dirname(%{DOCUMENT_ROOT})/robots.php [L]

i need get parent folder of DOCUMENT_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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top