dongshang3309 2014-08-19 22:22
浏览 81
已采纳

htaccess mod_rewrite规则只删除URL中的问号

I am looking for a condition/rule to rewrite any urls

www.mywebsite.com/?admin/*

to

www.mywebsite.com/admin/*

so ?admin to admin

AKA remove that question mark from the URL (only when followed by admin obviously). I know it's a weird URL but that's a long story, all I need is to rewrite all admin URLs so that the query question mark is removed.

Thank you

  • 写回答

1条回答 默认 最新

  • dqrnsg6439 2014-08-19 22:58
    关注

    Try the rule below

    RewriteEngine On
    RewriteCond %{THE_REQUEST} \s/+\?(admin[^\s&]+) [NC]
    RewriteRule ^ /%1? [R=301,L] 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Converting circular structure to JSON
  • ¥30 Hyper-v虚拟机相关问题,求解答。
  • ¥15 TSM320F2808PZA芯片 Bootloader
  • ¥45 谷歌浏览器出现开发者工具无法显示已创建的,但您可以调试已部署的代码。 状态代码 404, net::ERR HTTP RESPONSE CODE FAILURE
  • ¥15 如何解决蓝牙通话音频突发失真问题
  • ¥15 安装opengauss数据库报错
  • ¥15 【急】在线问答CNC雕刻机的电子电路与编程
  • ¥60 在mc68335芯片上移植ucos ii 的成功工程文件
  • ¥15 笔记本外接显示器正常,但是笔记本屏幕黑屏
  • ¥15 Python pandas