本文介绍了htaccess重定向与querystring的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何重定向以下网址 test/changefile.php?filename=top-ranked-colleges
How can I redirect the following url test/changefile.php?filename=top-ranked-colleges
到
test/top-ranked-colleges.php 使用htaccess重定向.
test/top-ranked-colleges.php using htaccess redirection.
任何人都可以帮助我.预先感谢.
Anybody please help me. Thanks in advance.
推荐答案尝试一下
RewriteCond %{QUERY_STRING} ^filename=(.*)$ RewriteRule .* test/%1.php? [R=301,L]将test/changefile.php?filename=top-ranked-colleges更改为test/top-ranked-colleges.php
RewriteCond %{REQUEST_URI} ^/(.*).php$ RewriteRule .* test/changefile.php?filename=$1 [L]将test/top-ranked-colleges.php更改为test/changefile.php?filename=top-ranked-colleges
更多推荐
htaccess重定向与querystring
发布评论