duanjianxu4288 2016-03-19 00:43
浏览 39

htaccess重写问题:如果文件夹存在,则重定向到查询字符串

I'm changing web servers and getting an issue on the new server. The new server is likely more up to date. Old one was using outdated stuff.

Goal

anything.mysite.com/text should display mysite.com/page.php?p=anything&n=text

Issue

On the new server if a folder named /text exists then the address bar changes to show anything.mysite.com/text/?p=anything&n=text and causes other issues. If folder doesn't exist it works fine.

My Code

RewriteCond %{REQUEST_FILENAME} !^.*\.(css|js|jpg|png|gif|php|otf|ttf|woff|eot|svg|bmp|mp3|flv)$
RewriteCond %{REQUEST_FILENAME} !^.*thumb.php$
RewriteCond %{HTTP_HOST} ^(.*)\.mysite\.com$ [NC] #SUB-DOMAINS ONLY
RewriteRule ^(.+/)?([^/]*)$ page.php?p=%1&n=$2 [QSA,L,NC]
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料