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 htaccess规则不存在';不行吗?_Php_.htaccess - Fatal编程技术网

Php htaccess规则不存在';不行吗?

Php htaccess规则不存在';不行吗?,php,.htaccess,Php,.htaccess,子文件夹的访问规则 Options +Includes <ifmodule mod_deflate.c> AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozill

子文件夹的访问规则

Options +Includes
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</ifmodule>

# Expires Headers - 2678400s = 31 days
<ifmodule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType text/html "access plus 7200 seconds"
  ExpiresByType image/gif "access plus 2678400 seconds"
  ExpiresByType image/jpeg "access plus 2678400 seconds"
  ExpiresByType image/png "access plus 2678400 seconds"
  ExpiresByType text/css "access plus 518400 seconds"
  ExpiresByType text/javascript "access plus 2678400 seconds"
  ExpiresByType application/x-javascript "access plus 2678400 seconds"
</ifmodule>

# Cache Headers
<ifmodule mod_headers.c>
  # Cache specified files for 31 days
  <filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf)$">
  Header set Cache-Control "max-age=2678400, public"
  </filesmatch>
  # Cache HTML files for a couple hours
  <filesmatch "\.(html|htm)$">
  Header set Cache-Control "max-age=7200, private, must-revalidate"
  </filesmatch>
  # Cache PDFs for a day
  <filesmatch "\.(pdf)$">
  Header set Cache-Control "max-age=86400, public"
  </filesmatch>
  # Cache Javascripts for 31 days
  <filesmatch "\.(js)$">
  Header set Cache-Control "max-age=2678400, private"
  </filesmatch>
</ifmodule>


RewriteEngine on

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]

RewriteRule ^home index.php [NC,L]


RewriteRule ^promo/offers/([0-9]+)/([^/]+)/?$ off.php?pid=$1&ct=$2 [L]
Options+包括
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
浏览器匹配^Mozilla/4 gzip纯文本/html
浏览器匹配^Mozilla/4\.0[678]无gzip
BrowserMatch\bMSIE!没有gzip!仅限gzip文本/html
#过期标头-2678400s=31天
过期于
ExpiresDefault“访问加1秒”
ExpiresByType text/html“访问加7200秒”
ExpiresByType image/gif“访问时间加2678400秒”
ExpiresByType图像/jpeg“访问时间加2678400秒”
ExpiresByType image/png“访问时间加2678400秒”
ExpiresByType文本/css“访问加518400秒”
ExpiresByType文本/javascript“访问时间加2678400秒”
ExpiresByType应用程序/x-javascript“访问时间加2678400秒”
#缓存头
#将指定的文件缓存31天
标题集缓存控制“最大年龄=2678400,公共”
#将HTML文件缓存几个小时
标题集缓存控制“最大年龄=7200,专用,必须重新验证”
#缓存PDF一天
标题集缓存控制“最大年龄=86400,公共”
#缓存Javascripts 31天
标题集缓存控制“最大年龄=2678400,专用”
重新启动发动机
重写条件%{HTTP_HOST}^www\.(.*)$[NC]
重写规则^(.*)$http://%1%{REQUEST_URI}[R=301,QSA,NC,L]
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
RewriteCond%{REQUEST_FILENAME}.php-f
重写规则^(+?)/?$$1.php[L]
重写规则^home index.php[NC,L]
重写规则^promo/offers/([0-9]+)/([^/]+)/?$off.php?pid=$1&ct=$2[L]
文件路径为

我想要

这条规则不能正常工作,请告诉我怎么办

错误是内部服务器错误


服务器遇到内部错误或配置错误,无法完成您的请求。

您到底有什么问题?请立即检查。我发布了所有代码如果错误为500,请检查您的错误日志。由于可能的配置错误,请求超出了10个内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用“LogLevel debug”获取回溯。此文件是新的还是只有
重写规则^promo/offers/
行是新的?你也没有考虑到那里的
ct/
。。