.htaccess仅当参数存在时才重定向

时间:2018-12-06 14:09:18

标签: .htaccess redirect url-redirection

您好,我想编写htaccess文件,使该URL localhost/img/pic.gif的访问被拒绝,否则,如果我得到类似的信息,localhost/img/pic.gif?var=welcome会将我重定向到另一个页面,接受我不接受的任何参数需要测试的是获取数字还是字母 可以用htaccess文件来做到这一点,我所知道的只是这一行:

 ErrorDocument 404 /pic.gif
 RewriteRule logo.gif  localhost/myproject

谢谢!

0 个答案:

没有答案