Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ModRewrite和php文件_Php_.htaccess_Mod Rewrite - Fatal编程技术网

ModRewrite和php文件

ModRewrite和php文件,php,.htaccess,mod-rewrite,Php,.htaccess,Mod Rewrite,服务器上有以下规则: RewriteEngine On RewriteBase /www_new 因为几乎没有其他项目。我现在必须把所有东西都指向那个文件夹。我有swf、woff、svg和ttf文件的问题,但我在这里添加了它们,它工作正常 RewriteRule !\.(swf|woff|svg|ttf|pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ index.php [L] 但我的问题是,我不能将它用于文件uploadify.php 我怎么能指出

服务器上有以下规则:

RewriteEngine On
RewriteBase /www_new
因为几乎没有其他项目。我现在必须把所有东西都指向那个文件夹。我有swf、woff、svg和ttf文件的问题,但我在这里添加了它们,它工作正常

RewriteRule !\.(swf|woff|svg|ttf|pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ index.php [L]
但我的问题是,我不能将它用于文件uploadify.php

我怎么能指出它

也许还有重写规则?比如,如果地址是/something/uploadify.php,那么将我指向/www_new/something/uploadify.php

此外,如果该规则只能用于主服务器,而不是本地主机,则最好是这样


感谢您的建议

您可以在现有规则之前使用以下规则:

RewriteEngine on
# this checks to see that the requested uri value is not starting with the "target folder" and prevents rewrite looping 
RewriteCond %{REQUEST_URI} !^/www_new
# rewrite /anychar/uploadify.php to /www_new/anychar/uploadify.php 
RewriteRule ^(.*uploadify\.php)$ /www_new/$1 [L]

非常感谢你。我首先用这个条件(对于主服务器,而不是本地主机)对其进行了一些改进,重写cond%{HTTP_HOST}^www\.myserver\.com