我怎么忽略了mod

编程入门 行业动态 更新时间:2024-10-23 11:24:21
本文介绍了我怎么忽略了mod_rewrite的目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想有modrewrite规则跳过目录 VIP 。我已经尝试了一些事情,你可以看到下面,但无济于事。

I'm trying to have the modrewrite rules skip the directory vip. I've tried a number of things as you can see below, but to no avail.

# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #RewriteRule ^vip$ - [PT] RewriteRule ^vip/.$ - [PT] #RewriteCond %{REQUEST_URI} !/vip RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress

我要如何modrewrite完全忽略 / VIP / 目录,以便所有的请求直接传递到文件夹?

How do I get modrewrite to entirely ignore the /vip/ directory so that all requests pass directly to the folder?

由于清晰度的要点:

  • 它托管在Dreamhost的
  • 的文件夹是一个字preSS目录中的
  • 的/ VIP /文件夹中包含一个WebDAV的.htaccess等(虽然我不认为这是重要的
推荐答案

尝试之前,任何其他规则把这个。

Try putting this before any other rules.

RewriteRule ^vip - [L,NC]

这将匹配任何URI开始 VIP 。

  • 的 - 表示无可奈何。
  • 的→表示,这应该是最后一条规则;不顾一切以下。
  • 的 NC 意味着没有情况(所以贵宾也匹配)。
  • The - means do nothing.
  • The L means this should be last rule; ignore everything following.
  • The NC means no-case (so "VIP" is also matched).

请注意,它匹配任何的开始的 VIP 。这位前pression ^ VIP $ 将匹配 VIP 而不是 VIP / 或 VIP / index.html的。在 $ 可能是您的垮台。如果你真的想这样做的权利,你可能要与去^ VIP(/ | $)这样你就不会匹配 VIP-页html的

Note that it matches anything beginning vip. The expression ^vip$ would match vip but not vip/ or vip/index.html. The $ may have been your downfall. If you really want to do it right, you might want to go with ^vip(/|$) so you don't match vip-page.html

更多推荐

我怎么忽略了mod

本文发布于:2023-11-01 11:52:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549265.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我怎么   忽略了   mod

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!