DocumentRoot的背后MOD-重写加载文件(Mod-Rewrite loading files behind the DocumentRoot)

   IT问题网   2018-11-08 00:00:00

问 题

我用的.htaccess 和的mod_rewrite 指向驻留在documentroot的隐藏文件。我的文件夹结构如下所示:

other_files /

我有一个的.htaccess 文件根目录包含以下内容:

重写规则^(。*)$ /家庭/ other_files / $ 1

如果我尝试访问 我收到以下错误:





 目录"/家/ other_files"

到apache在你的服务器配置将能够从中起到什么。举个例子,我的documentroot是/ var / www但本节中的默认提供网站:

 别名/ doc /"的/ usr /共享/ doc /"
目录"的/ usr /共享/ doc /"
从127.0.0.0/允许:: 1/128

您可以再重写url去/ doc /,服务器会知道从哪里获取的文件。



  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


什么是L的[QSA,L] htaccess的(What is L in [QSA, L] in htaccess)

problem qsa means that if there's a query string passed ...

在Mac OSX上安装的CakePHP:apache的问题(install CakePHP on Mac osx: apache problems)

problem first time cake user and i'm having real apache p ...

的1and1 mod_rewrite的问题(1and1 mod_rewrite issues)

problem i'm currently trying to have my 1and1 host an .ht ...

如何摆脱PHP扩展在.htaccess中(How to get rid of .php extension in .htaccess)

problem i am trying to do a mod-rewrite in my .htaccess t ...

我怎样才能获得用户的输入使用的htaccess / htpasswd的时候?(How can I get a user's input when using htaccess/htpasswd)

problem i want to create a log in system using htaccess ...

字preSS自定义查询字符串和放大器; pretty的网址 - 如何?(Wordpress custom Querystrings & Pretty URL's - How)

problem i have a perfectly good (so far) setup of wordpre ...

阿帕奇的.htaccess:如何从URL如果不是'ID =(。*)`删除问号?(Apache .htaccess: How to remove question mark from URL if not `id=(.*)`)

problem how to make .htaccess to remove question mark fro ...

重写所有的虚拟子域使用htaccess的同一个文件夹(Rewrite all virtual subdomains to same folder using htaccess)

problem i have been searching the internet trying to find ...

扩展名的URL斜杠重定向(Extensionless URL trailing slash redirect)

problem i've tested the code below on several domains hos ...

绑定域名重定向到子文件夹(Parked domain redirect to subfolder)

problem i have 2 domain: ...

子域的基础上codeIgniter控制器名称(Subdomain based on CodeIgniter controller name)

problem suppose i have this two different mod ...

移动codeigniter项目到Amazon EC2,htaccess以及ModRewrite问题(Moving Codeigniter Project to Amazon EC2, htaccess and ModRewrite Problems)

problem i am attempting to move my codeigniter projects f ...

htaccess的不工作的GoDaddy的(htaccess not working on godaddy)

problem i recently moved to godaddy and the . ...

堵semalt引荐与htaccess的规则(blocking semalt referrers with htaccess rules)

problem i have implemented the following code to htaccess ...

获取与htaccess的网址两个变量(Getting two variables in the URL with htaccess)

problem what way it is to be to get two get methods in th ...

排除来自重写规则的文件夹/目录(Exclude a folder/directory from RewriteRule)

problem i have a pretty standard wordpress .htaccess with ...

如何只允许在国家访问(How to allow access only within country)

problem i found this web site to generate a .htaccess to ...

在什么条件下会在浏览器缓存视频文件?(Under what conditions will the browser cache <video> files)

problem under what conditions will the browse ...

如何调试mod_rewrite规则?(How can I debug mod_rewrite rules)

problem this is a case of "ask a question and answer it m ...

自定义404错误页面 - 只为PHP页面(Custom 404 error page -- for PHP pages only)

problem i have a personalized page for 404 with htaccess ...