模式_重写(.htaccess)错误的结果?

模式_重写(.htaccess)错误的结果?,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,嗨,我不确定出了什么问题,我用各种各样的规则在域上大量重写,没有问题, 现在在子域上重写结果点错误的数据 这个空间可以从多个域访问,我想通过主机名切换到css内容的特定子文件夹 RewriteEngine on # - - - shared space / multiple css.*.tld subdomains - - - # domain 1 RewriteCond %{HTTP_HOST} ^css\.firstdomain\.com$ RewriteRule ^css/(.*)$

嗨,我不确定出了什么问题,我用各种各样的规则在域上大量重写,没有问题, 现在在子域上重写结果点错误的数据

这个空间可以从多个域访问,我想通过主机名切换到css内容的特定子文件夹

RewriteEngine on

# - - - shared space / multiple css.*.tld subdomains - - -

# domain 1 
RewriteCond %{HTTP_HOST} ^css\.firstdomain\.com$
RewriteRule ^css/(.*)$  fir/$1

# domain 2
RewriteCond %{HTTP_HOST} ^css\.seconddomain2\.com$
RewriteRule ^css/(.*)$  sec/$1

# *.min.css -> scss.php?file=*
RewriteRule ^(.+)\.min\.css$ scss.php?scss=$1 [QSA]

# 
基本上,首先有一些规则可以将universal/css/path重写为该主机文件的特定路径,然后最后一行应该将*.min.css更改为scss.php?scss=$1,这样它会将文件/不带扩展名.min.css/作为参数发送到php文件,然后php文件会搜索扩展名为.scss的文件以检查上次修改的文件,并返回缓存或将源scss文件重新编译到缓存的css文件

现在我希望当我进入时:

应改写为:

但它改写为 -因为某种原因,它几乎重写了两次,有人经历过这种情况并找到了可能的原因吗

第一部分进入直线时会出现某种问题 重写以更正scss.php?file=fir/first/first

噢,找到了! 在每个域的规则之后,我错过了[L]最后一个标志, 现在它工作正常了

此处填写代码:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^css\.firstdomain\.com$
RewriteRule ^css/(.*)$  fir/$1 [QSA,L]

RewriteRule ^(.+)\.min\.css$ scss.php?scss=$1 [QSA,L]