htaccess重写规则重定向

发布于 2024-09-30 01:07:13 字数 327 浏览 1 评论 0原文

我有一些旧的网址

http://www.website.com/result/?q=&result=1
http://www.website.com/result/?q=&result=2
http://www.website.com/result/?q=&result=3
http://www.website.com/result/?q=&result=4

等..可能会达到大约 60

我是否可以创建一个规则,将任何看起来像这样的查询重定向到主页 /home/ 而不是我尝试单独重定向所有查询?

提前致谢

I have some old urls

http://www.website.com/result/?q=&result=1
http://www.website.com/result/?q=&result=2
http://www.website.com/result/?q=&result=3
http://www.website.com/result/?q=&result=4

etc.. probably going up to about 60

Is there anyway I can create one rule that redirects any query that looks like this to the home page /home/ instead of my trying to redirect all of them individualy?

Thanks in advance

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

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

发布评论

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

评论(1

瞎闹 2024-10-07 01:07:13

是的,我想你正在使用 apache HTTPD。在您的服务器配置中,您可以定义一个正则表达式来过滤您想要的模式。例如:

<FilesMatch "/site/*">
...
</FilesMatch> 

定义一个正则表达式并告诉重定向到哪里或做什么。

希望这有帮助,干杯

yes, i suppose you are using apache HTTPD. In your server configuration you can define an regular expression which filter the pattern you want. For example:

<FilesMatch "/site/*">
...
</FilesMatch> 

Define a RegExp and tell where to redirect or what to do.

Hope this helps, Cheers

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