Php htaccess在交付完全不同的脚本之前在服务器上重写执行脚本

Php htaccess在交付完全不同的脚本之前在服务器上重写执行脚本,php,apache,.htaccess,Php,Apache,.htaccess,My/mobile目录的My.htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> <VirtualH

My/mobile目录的My.htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
<VirtualHost *:80>
     DocumentRoot /var/www/mobile
     ServerName m.mysite.com
     ServerAlias m.mysite.net
</VirtualHost>
我的索引中有一个mysql查询,它基本上会增加页面计数,当我打开m.mysite.net/style.css,即/mobile/style.css时,它会在服务器上执行index.php,但仍然会毫无问题地提供style.css。。。如果style.css是可定位文件,为什么要执行index.php

以下是该目录的apache配置:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
<VirtualHost *:80>
     DocumentRoot /var/www/mobile
     ServerName m.mysite.com
     ServerAlias m.mysite.net
</VirtualHost>
我如何避免执行任何脚本,而只是交付绝对文件?
我需要更改什么?

您的.htaccess似乎是正确的。应在不使用index.php的情况下传递style.css

但是。您可以在css中包含图像,类似于

background: url(/img/still/not/exists.png)
此图像可能丢失,并且您有index.php调用

无论如何,这当然是一个猜测: