URL 重写 - 自动 - 非手动
我在 .htaccess 文件中编写了重定向规则 如果我们手动提供该链接,它会重定向某些页面。 但我想要的是,它应该自动重定向......
我的要求是:
而不是这个链接,
links.php?page=1&ipp=All&exchange=adddata
它应该自动重定向
http://example.com/folder1/links/1/All/exchange.html
我在.htaccess中的规则是
RewriteEngine On RewriteRule ^([0-9]+)/All/exchange.html$ links.php?page=1&ipp=All&exchange=adddata
I have written a rule for redirecting in .htaccess file
its redirecting for some pages , if we give that link manually..
but what i want is ,it should redirect automatically....
My requirement is :
Instead of this link,
links.php?page=1&ipp=All&exchange=adddata
It should be redirected automatically
http://example.com/folder1/links/1/All/exchange.html
MY rule in .htaccess is
RewriteEngine On
RewriteRule ^([0-9]+)/All/exchange.html$ links.php?page=1&ipp=All&exchange=adddata
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的示例并不完全清楚,但可能是这样的:
在上面的评论中,您错误地交换了原始网址和应该重定向到的网址,而且您没有在新网址中设置任何动态参数 - 我想您需要。但正如我所说,为了确定这一点,我们需要更多的例子。
希望这有帮助!
It's not completely clear by your example, but it could be this:
In the comment above you mistakenly swaped the original url and the url it should be redirected to plus you didn't set any dynamic parameters in your new url - which I suppose you need. But as I said, to be sure about it we'd need more examples.
Hope this helps!