mod_rewrite 规则包括短代码排除实际页面

发布于 2024-09-30 08:55:57 字数 173 浏览 2 评论 0原文

我正在尝试构建一个 URL 缩短器,并且需要将 domain.com/azAZ09 的任何传入链接转发到 page.php?code=azAZ09,同时忽略根目录中以 .php 结尾的任何合法页面,并忽略对子目录的任何请求目录内容

不幸的是,我似乎只是在黑暗中摸索。有人至少可以向我指出一个清晰易懂的教程或帮助我吗?

I'm trying to build a URL shortener and need to have any incoming links for domain.com/azAZ09 forward to page.php?code=azAZ09 while ignoring any legitimate pages that end in .php in root and ignore any requests for sub-directory contents

Unfortunately, I appear to just be stabbing in the dark. any chance someone could at least point me to a clear and understandable tutorial or help me out?

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

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

发布评论

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

评论(1

小女人ら 2024-10-07 08:55:57

没关系。在此处找到了一份很好的备忘单

RewriteRule ^([A-Za-z0 -9]+)?$index.php?sc=$1 [L]

nevermind. found a good cheat sheet here

RewriteRule ^([A-Za-z0-9]+)?$ index.php?sc=$1 [L]

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