我已经看到了关于类似请求的几个问题,但是,我并不想重定向到一个自定义制作的URL。我只是想获得那些已与通用网址,并将其重定向到一个登陆页面。
I've seen several questions regarding similar requests, however, I'm not trying to redirect to a custom crafted URL. I just want to take common URLs that have been linked to and redirect them to a landing page.
例如,我要赶上像下面特定的URL,但仅此网址:
For example, I want to catch a specific URL like the following, but only this URL:
example/forum/viewtopic.php? F = 12& T公司= 345
...并重定向到:
example/landing-page.html
我有一个不再存在的几个环节,所以我会加入4或5重定向到更多有用的网页,因为他们目前正在打404的。
I have a few links which no longer exist, so I'll be adding 4 or 5 redirects to more useful pages since they're currently hitting 404's.
在此先感谢!
推荐答案添加到您的htaccess文件在你的文档根目录:
Add this to your htaccess file in your document root:
RewriteCond %{QUERY_STRING} ^f=12&t=345$ RewriteRule ^forum/viewtopic.php$ /landing-page.html [R=301]
从本质上讲要匹配这个查询字符串的RewriteCond 和URI中的重写规则。
更多推荐
htaccess的重写规则重定向的URL包含具体参数
发布评论