dtwzwmv87399 2015-03-21 02:01
浏览 94

.htaccess重写规则冲突

I have a .htaccess file written as follows:

RewriteEngine On

RewriteRule ^/?([^/.]+)$ display.php?category=$1 [B,L] 
RewriteRule ^gallery/([^/.]+)/?$ gallery.php?category=$1 [L]
RewriteRule ^([-_\+A-Za-z0-9,]+)$ displayitem.php?item=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/?$ displayitem.php?item=$1&start=$2&page=$3 [L,QSA]

The problem occurs while displaying the displayitem.php?item=$1. When I try to execute this command, the page will stay on previous page and the displayitem.php will not be found.

This is weird. If I comment out the following line:

RewriteRule ^/?([^/.]+)$ display.php?category=$1 [B,L] 

which is used to pass utf-8 character, everything works fine and all the rules will be executed and all the parameters will be passed. However, utf-8 character will not be passed correctly and echo Page Not found.

Please help!! Thanks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
    • ¥15 Vue3地图和异步函数使用
    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用