在mod_rewrite的绝对文件路径 - 允许吗? [英] Absolute file paths in mod_rewrite - allowed?

查看:115
本文介绍了在mod_rewrite的绝对文件路径 - 允许吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个后续<一个href=\"http://stackoverflow.com/questions/2188444/mod-rewrite-to-absolute-path-in-htaccess-turning-up-404\">this问题。

This is a follow-up to this question.

我想建立一个的mod_rewrite 治所在重写目标是Web根目录外的绝对路径,如

I am trying to build a mod_rewrite rule where the rewriting target is an absolute path outside the web root, like

RewriteRule ^manual(/(.*))?$ /www/htdocs/customername/manual/$2 [L]

我需要这样做,因为我不能使用别名的.htaccess 上下文(共享托管)

I need to do this because I can't use Alias in a .htaccess context (shared hosting).

有回应这不是可能在暗示所有

There are responses hinting at this not being possible at all.

这是真的吗?我找不到手册中任何明确的信息。

Is this true? I can't find any clear info in the manual.

可能有人澄清时,绝对路径是可能的,当他们没有?

Could somebody clarify when absolute paths are possible, and when they are not?

推荐答案

这当然是可能在你的服务器配置使用绝对文件路径。

It is certainly possible to use absolute file paths in your server config.

您将无法做到这一点在的.htaccess 文件虽然,因为这将让你从其他访问您的文档根目录之外读取文件,甚至文件位置...&GT;被认为是客户通过&LT保护。

You won't be able to do that in a .htaccess file though, since that would give you access to read files outside your document root, even files from other customers that were supposed to be protected by a <Location ...> block.

这篇关于在mod_rewrite的绝对文件路径 - 允许吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆