Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/291.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
Php 重写cond%{REQUEST_FILENAME}-f并重写cond%{REQUEST_FILENAME}-d工作不正常_Php_.htaccess_Mod Rewrite_Errordocument - Fatal编程技术网

Php 重写cond%{REQUEST_FILENAME}-f并重写cond%{REQUEST_FILENAME}-d工作不正常

Php 重写cond%{REQUEST_FILENAME}-f并重写cond%{REQUEST_FILENAME}-d工作不正常,php,.htaccess,mod-rewrite,errordocument,Php,.htaccess,Mod Rewrite,Errordocument,我的.htaccess文件包含以下代码 Options +FollowSymlinks RewriteEngine On #php_flag display_errors on # compress text, html, javascript, css, xml: AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE tex

我的.htaccess文件包含以下代码

Options +FollowSymlinks
RewriteEngine On

#php_flag display_errors on

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript


# Or, compress certain file types by extension:
#<files *.html>
#SetOutputFilter DEFLATE
#</files>



#RewriteCond %{REMOTE_HOST} !^12\.188\.175\.226
#RewriteCond %{REQUEST_URI} !/maintenance\.html$
#RewriteRule (.*).html$ /maintenance\.html [R=302,L]

#RewriteCond %{REMOTE_HOST} !^12\.188\.175\.226
#RewriteCond %{REQUEST_URI} !/maintenance\.html$
#RewriteRule ^$ /maintenance\.html [R=302,L]

RewriteCond %{HTTP_HOST} ^(.*)find-junkyards.com [or]
RewriteCond %{HTTP_HOST} ^(.*)findjunkyards.net [or]
RewriteCond %{HTTP_HOST} ^junkyardsnearme.com
RewriteRule (.*) http://www.junkyardsnearme.com/$1 [R=301,L]

#RewriteRule (.*) http://www.junkyardsnearme.com/$1 [R=301,L]

#RewriteRule (.*) http://www.junkyardsnearme.com/$1 [R=301,L]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php?_req=/$1&%{QUERY_STRING} [L]
RewriteRule ^(.*)$ index.php/$1 [L]


#ErrorDocument 404 http://dev.junkyardsnearme.com/admin/accounts/error404 
它将不允许我通过网站流量。我也试过了

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php?_req=/$1&%{QUERY_STRING} [L]
RewriteRule ^(.*)$ index.php/$1 [L]
但对我来说还是不行

任何想法为什么这不工作,请尽快回答这将是巨大的帮助


提前感谢。

此.htaccess位于何处,提供了什么URL 404?验证.htaccess是否已启用,通过将相同的垃圾随机文本放在.htaccess上,看看它是否会生成500个内部服务器错误?感谢您的建议,但我得到了解决方案。htaccess代码将我重定向到一个controller.php文件,在该文件中写入错误消息,然后我更改了路径,并显示了我自己的自定义404页面。那么您的问题现在解决了吗?
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php?_req=/$1&%{QUERY_STRING} [L]
RewriteRule ^(.*)$ index.php/$1 [L]