mod_rewrite 规则包括短代码排除实际页面
我正在尝试构建一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系。在此处找到了一份很好的备忘单
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]