重定向到新站点,除非位于指定目录中

发布于 2024-10-10 11:58:27 字数 281 浏览 0 评论 0原文

我经营一个图像托管网站。让我们先了解以下信息。

Site: imagehosting.com
Tiny: imgho.st
Directory: n/

目录是图像的存储位置。无论如何。我正在尝试找出一种 apache 重写方法来将 imgho.st 重定向到 imagehosting.com 除非在 n/ 目录中。所以除非用户是imgho.st/n/83md.png重定向到imagehosting.com。

有人可以帮我解决这个问题吗?

谢谢!

I run an image hosting site. Lets just go with the following information.

Site: imagehosting.com
Tiny: imgho.st
Directory: n/

Directory is where the images are stored. Anyways. I'm trying to figure out an apache rewrite method to redirect imgho.st to imagehosting.com UNLESS in the n/ directory. So unless the user is imgho.st/n/83md.png redirect to imagehosting.com.

Could anybody help me out with this?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

提笔书几行 2024-10-17 11:58:27

您可以将 RewriteCond 放在 RewriteRule 之前

RewriteCond %{REQUEST_URI} !\/n\/.*$
RewriteRule ...

You can put RewriteCond before your RewriteRule

RewriteCond %{REQUEST_URI} !\/n\/.*$
RewriteRule ...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文