htaccess的与查询串除去的特定地址 [英] htaccess removing a specific address with a query string

查看:132
本文介绍了htaccess的与查询串除去的特定地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,这个问题已经到了那里,我与查询字符串一个特定的站点URL得到一个404错误。这不是我一个网站,我的工作常常让我不知道是否有任何疑问应该仍然可以使用。我想这我和它没有工作。

I have a site where the issue has come up where I am getting a 404 error on a specific site URL with a query string. This isn't I a site I work on frequently so I am not sure if any queries should still be used. I tried this myself and it didn't work.

Redirect 301 /category.aspx?id=MISC34 /

我要301直接向具体到www.example.com/category.aspx?id=MISC34转到主页。这并没有为我工作。这是道preSS知道有没有关系。

I want the 301 direct to be specific to www.example.com/category.aspx?id=MISC34 to go to the homepage. This did not work for me. It is on Wordpress if that matters.

我不就是深谙htaccess的。任何帮助将apperciated。

I am not that well versed in htaccess. Any help would be apperciated.

推荐答案

您可以使用的.htaccess

RewriteEngine on
RewriteCond %{QUERY_STRING} (^|&)id=MISC34(&|$) [NC]
RewriteRule ^category\.aspx$ /? [L,NC,R=301]

这篇关于htaccess的与查询串除去的特定地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆