dongyuan7981 2018-10-04 03:41
浏览 15

如何使用htaccess隐藏查询字符串

When I redirect the 301 link to the new url is added query string, I want to hide or delete it, what should I do. My .htaccess like :

 RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule ^([^?]*) index.php?mod=mod&cmd=$1 [L]

    Redirect 301 /category1.html http://example.com/list/category1

And result : http://example.com/list/category1?mod=mod&cmd=list/category1

I want it to show up like this : http://example.com/list/category1

Thanks all.

  • 写回答

0条回答 默认 最新

    报告相同问题?