需要将htaccess文件转换为php.ini

需要将htaccess文件转换为php.ini,php,apache,.htaccess,Php,Apache,.htaccess,我正在将一个网站从一个主机移动到另一个主机,但是这个新主机的配置不同,htaccess密码不起作用。他们告诉我需要通过php.ini而不是htaccess进行设置 引用hosts消息的一部分:“错误包括尝试在.htaccess文件中使用php_值指令,当我们以CGI方式运行php时,这将不起作用。” 我对这些文件不是很熟悉,我在下面包含了我的htaccess文件,不知道是否有人能解释哪些位是不正确的?URL已被替换 # --------------------------------------

我正在将一个网站从一个主机移动到另一个主机,但是这个新主机的配置不同,htaccess密码不起作用。他们告诉我需要通过php.ini而不是htaccess进行设置

引用hosts消息的一部分:“错误包括尝试在.htaccess文件中使用php_值指令,当我们以CGI方式运行php时,这将不起作用。”

我对这些文件不是很熟悉,我在下面包含了我的htaccess文件,不知道是否有人能解释哪些位是不正确的?URL已被替换

# ----------------------------------------------------------------------
# Better website experience for IE users
# ----------------------------------------------------------------------

# Force the latest IE version, in various cases when it may fall back to IE7 mode
#  github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk

<IfModule mod_headers.c>
    Header set X-UA-Compatible "IE=Edge,chrome=1"
    # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
    <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" >
      Header unset X-UA-Compatible
    </FilesMatch>
</IfModule>

#  <IfModule mod_headers.c>
#    Header set Access-Control-Allow-Origin "*"
#  </IfModule>

<FilesMatch "\.(svg|ttf|ttc|otf|eot|woff|font.css)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>



# ----------------------------------------------------------------------
# Proper MIME type for all files
# ----------------------------------------------------------------------


# JavaScript
#   Normalize to standard type (it's sniffed in IE anyways) 
#   tools.ietf.org/html/rfc4329#section-7.2
AddType application/javascript         js

# Audio
AddType audio/ogg                      oga ogg
AddType audio/mp4                      m4a

# Video
AddType video/ogg                      ogv
AddType video/mp4                      mp4 m4v
AddType video/webm                     webm

# SVG.
#   Required for svg webfonts on iPad
#   twitter.com/FontSquirrel/status/14855840545
AddType     image/svg+xml              svg svgz 
AddEncoding gzip                       svgz

# Webfonts                             
AddType application/vnd.ms-fontobject  eot
AddType application/x-font-ttf    ttf ttc
AddType font/opentype                  otf
AddType application/x-font-woff        woff

# Assorted types                                      
AddType image/x-icon                   ico
AddType image/webp                     webp
AddType text/cache-manifest            appcache manifest
AddType text/x-component               htc
AddType application/x-chrome-extension crx
AddType application/x-xpinstall        xpi
AddType application/octet-stream       safariextz
AddType text/x-vcard                   vcf


# ----------------------------------------------------------------------
# Gzip compression
# ----------------------------------------------------------------------

<IfModule mod_deflate.c>

# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  </IfModule>
</IfModule>

# HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
<IfModule filter_module>
  FilterDeclare   COMPRESS
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/html
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/css
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/plain
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/x-component
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/javascript
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/json
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xhtml+xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/rss+xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/atom+xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/vnd.ms-fontobject
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/svg+xml
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/x-font-ttf
  FilterProvider  COMPRESS  DEFLATE resp=Content-Type $font/opentype
  FilterChain     COMPRESS
  FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
</IfModule>

<IfModule !mod_filter.c>
  # Legacy versions of Apache
  AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
  AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
  AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</IfModule>
</IfModule>




<IfModule mod_expires.c>
  ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
  ExpiresDefault                          "access plus 1 month"

# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
  ExpiresByType text/cache-manifest       "access plus 0 seconds"

# Your document html 
  ExpiresByType text/html                 "access plus 0 seconds"

# Data
  ExpiresByType text/xml                  "access plus 0 seconds"
  ExpiresByType application/xml           "access plus 0 seconds"
  ExpiresByType application/json          "access plus 0 seconds"

# Feed
  ExpiresByType application/rss+xml       "access plus 1 hour"
  ExpiresByType application/atom+xml      "access plus 1 hour"

# Favicon (cannot be renamed)
  ExpiresByType image/x-icon              "access plus 1 week" 

# Media: images, video, audio
  ExpiresByType image/gif                 "access plus 1 month"
  ExpiresByType image/png                 "access plus 1 month"
  ExpiresByType image/jpg                 "access plus 1 month"
  ExpiresByType image/jpeg                "access plus 1 month"
  ExpiresByType video/ogg                 "access plus 1 month"
  ExpiresByType audio/ogg                 "access plus 1 month"
  ExpiresByType video/mp4                 "access plus 1 month"
  ExpiresByType video/webm                "access plus 1 month"

# HTC files  (css3pie)
  ExpiresByType text/x-component          "access plus 1 month"

# Webfonts
  ExpiresByType font/truetype             "access plus 1 month"
  ExpiresByType font/opentype             "access plus 1 month"
  ExpiresByType application/x-font-woff   "access plus 1 month"
  ExpiresByType image/svg+xml             "access plus 1 month"
  ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# CSS and JavaScript
  ExpiresByType text/css                  "access plus 1 year"
  ExpiresByType application/javascript    "access plus 1 year"

  <IfModule mod_headers.c>
    Header append Cache-Control "public"
  </IfModule>

</IfModule>



<IfModule mod_headers.c>
  Header unset ETag
</IfModule>

FileETag None

Options -MultiViews 

AddDefaultCharset utf-8

AddCharset utf-8 .html .css .js .xml .json .rss .atom

Options -Indexes

<IfModule php5_module>
    php_value session.cookie_httponly true
    php_flag short_open_tag on
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule "(^|/)\." - [F]

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

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?p=$1 [QSA]
</IfModule>
#----------------------------------------------------------------------
#为IE用户提供更好的网站体验
# ----------------------------------------------------------------------
#强制使用最新的IE版本,在各种情况下可能会退回到IE7模式
#github.com/rails/rails/commit/123eb25#commitcomment-118920
#如果安装ChromeFrame是为了给穷人带来更好的体验,请使用它
标题集X-UA-兼容“IE=Edge,chrome=1”
#mod_标题无法按内容类型匹配,但我们不希望在*everything*…上发送此标题。。。
标题未设置X-UA-Compatible
#  
#标题集访问控制允许原点“*”
#  
标题集访问控制允许原点“*”
# ----------------------------------------------------------------------
#所有文件的正确MIME类型
# ----------------------------------------------------------------------
#JavaScript
#标准化为标准类型(它在IE中被嗅探到)
#tools.ietf.org/html/rfc4329#第7.2节
AddType应用程序/javascript js
#音频
AddType音频/ogg oga ogg
AddType音频/mp4 m4a
#录像带
AddType视频/ogg ogv
AddType视频/mp4 mp4 m4v
AddType视频/webm webm
#SVG。
#iPad上的svg webfonts需要
#twitter.com/FontSquirrel/status/14855840545
AddType image/svg+xml svg svgz
加法编码gzip svgz
#网络字体
AddType应用程序/vnd.ms-fontobject eot
AddType应用程序/x-font-ttf ttf ttc
AddType字体/opentype otf
AddType应用程序/x-font-woff woff
#各种类型
AddType图像/x图标图标图标
AddType图像/webp webp
AddType文本/缓存清单appcache清单
AddType文本/x组件htc
AddType应用程序/x-chrome-extension crx
AddType应用程序/x-xpinstall xpi
AddType应用程序/八进制流safariextz
AddType text/x-vcard vcf
# ----------------------------------------------------------------------
#Gzip压缩
# ----------------------------------------------------------------------
#针对破损的标题强制放气developer.yahoo.com/blogs/ydn/posts/2010/12/push-beyond-gzip/
SetEnvIfNoCase^((gzip | deflate)\s*,?\s*)+|[X~-]{4,13}$有接受编码
RequestHeader追加接受编码“gzip,deflate”env=HAVE_Accept-Encoding
#HTML、TXT、CSS、JavaScript、JSON、XML、HTC:
FilterDeclare压缩
FilterProvider COMPRESS DEFLATE resp=内容类型$text/html
FilterProvider COMPRESS DEFLATE resp=内容类型$text/css
FilterProvider COMPRESS-DEFLATE resp=内容类型$text/plain
FilterProvider COMPRESS DEFLATE resp=内容类型$text/xml
FilterProvider COMPRESS-DEFLATE resp=内容类型$text/x-component
FilterProvider COMPRESS DEFLATE resp=内容类型$application/javascript
FilterProvider COMPRESS DEFLATE resp=内容类型$application/json
FilterProvider COMPRESS DEFLATE resp=内容类型$application/xml
FilterProvider COMPRESS DEFLATE resp=内容类型$application/xhtml+xml
FilterProvider COMPRESS DEFLATE resp=内容类型$application/rss+xml
FilterProvider COMPRESS DEFLATE resp=内容类型$application/atom+xml
FilterProvider COMPRESS DEFLATE resp=内容类型$application/vnd.ms-fontobject
FilterProvider COMPRESS DEFLATE resp=内容类型$image/svg+xml
FilterProvider COMPRESS-DEFLATE resp=内容类型$application/x-font-ttf
FilterProvider COMPRESS DEFLATE resp=内容类型$font/opentype
过滤链压缩
过滤器协议压缩放气变化=是;byteranges=否
#Apache的遗留版本
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE应用程序/javascript
AddOutputFilterByType DEFLATE text/xml应用程序/xml文本/x组件
AddOutputFilterByType DEFLATE应用程序/xhtml+xml应用程序/rss+xml应用程序/atom+xml
AddOutputFilterByType DEFLATE image/svg+xml应用程序/vnd.ms-fontobject应用程序/x-font-ttf font/opentype
过期于
#也许最好将过期规则列入白名单?也许。
ExpiresDefault“访问加1个月”
#cache.appcache需要在FF 3.6中重新请求(感谢Remy~引入HTML5)
ExpiresByType文本/缓存清单“访问加0秒”
#您的文档是html
ExpiresByType text/html“访问加0秒”
#资料
ExpiresByType text/xml“访问加0秒”
ExpiresByType应用程序/xml“访问加0秒”
ExpiresByType应用程序/json“访问加0秒”
#喂
ExpiresByType应用程序/rss+xml“访问加1小时”
ExpiresByType应用程序/atom+xml“访问加1小时”
#Favicon(无法重命名)
ExpiresByType图像/x图标“访问加1周”
#媒体:图像、视频、音频
ExpiresByType image/gif“访问加1个月”
ExpiresByType图像/png“访问加1个月”
ExpiresByType图像/jpg“访问加1个月”
过期按类型图像/jpeg“访问加1个月”
<IfModule php5_module>
php_value session.cookie_httponly true
php_flag short_open_tag on
</IfModule>