[英].htaccess rewrite rule for redirects
I've been fighting this for a while and can't seem to make it work. 我已经为此战斗了一段时间,但似乎无法使其正常工作。 My old system used a lot of query strings to render pages but they are no longer necessary. 我的旧系统使用大量查询字符串来呈现页面,但是不再需要它们。 My url is below: 我的网址如下:
The name links is coincidental and not necessarily from the old pages name. 名称链接是偶然的,不一定来自旧页面的名称。 I need to check which section and catid is present and redirect them to the appropriate page from what it is. 我需要检查哪个部分和catid存在,并将它们从什么重定向到适当的页面。 I tried the following but this just seems to do nothing. 我尝试了以下操作,但这似乎无济于事。 What am I doing wrong? 我究竟做错了什么?
RewriteCond %{REQUEST_URI} ^links.php$
RewriteCond %{QUERY_STRING} ^section=5$
RewriteCond %{QUERY_STRING} ^catid=52$
RewriteRule ^(.*)$ /mhfs/links? [R=301]
Any help would be GREATLY appreciated. 任何帮助将不胜感激。
You must turn the rewrite engine on for it to work. 您必须打开重写引擎才能使其正常工作。 You probably don't want the regex start symbol on the replacement: 您可能不希望替换中使用正则表达式开始符号:
RewriteEngine on 在RewriteEngine上
RewriteCond ... RewriteCond ...
RewriteRule ... RewriteRule ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.