2013-05-21 68 views
1

好的,所以我的情況很簡單(雖然尚未解決)。與香草篝火/ CI安裝和.htaccess的問題

  • 我下載Bonfire (for CodeIgniter)
  • 在我的網站文件夾中創建一個新的文件夾,讓我們說bonfire(我使用的XAMPP適用於Mac)
  • 我要去http://localhost/~drkameleon/bonfire(其中安裝頁應出現基於該文檔)
  • 而且我收到了一條錯誤消息

服務器錯誤!

服務器遇到內部錯誤,無法完成 您的請求。服務器超載或者在CGI腳本中出現錯誤 。


現在,我在想,它可能有一些做的安裝文件夾實際上是一個子文件夾(我認爲這是什麼地方篝火的文件中提到,太)。但是,我仍然不知道在Bonfire附帶的文件巨大的.htaccess中究竟要調整什麼。

所以,在這裏,它是:

# ---------------------------------------------------------------------- 
# Webfont access 
# ---------------------------------------------------------------------- 

# Allow access from all domains for webfonts. 
# Alternatively you could only whitelist your 
# subdomains like "subdomain.example.com". 

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

# ---------------------------------------------------------------------- 
# 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/xml      rss atom xml rdf 
    AddType application/x-chrome-extension  crx 
    AddType application/x-opera-extension  oex 
    AddType application/x-xpinstall    xpi 
    AddType application/octet-stream   safariextz 
    AddType application/x-web-app-manifest+json webapp 
    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 $image/x-icon 
    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/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype 
    </IfModule> 

</IfModule> 

# ---------------------------------------------------------------------- 
# Start rewrite engine 
# ---------------------------------------------------------------------- 

# Turning on the rewrite engine is necessary for the following rules and features. 
# FollowSymLinks must be enabled for this to work. 

<IfModule mod_rewrite.c> 
    Options +FollowSymlinks -Indexes 
    RewriteEngine On 

    # If you installed Bonfire in a subfolder, you will need to 
    # change the following line to match the subfolder you need. 
    # http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase 
    RewriteBase/

    #Removes access to the system folder by users. 
    #Additionally this will allow you to create a System.php controller, 
    #previously this would not have been possible. 
    #'system' can be replaced if you have renamed your system folder. 
    RewriteCond %{REQUEST_URI} ^bonfire/codeigniter.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 
</IfModule> 

# Rewrite "www.example.com -> example.com" 

<IfModule mod_rewrite.c> 
    RewriteCond %{HTTPS} !=on 
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] 
    RewriteRule^http://%1%{REQUEST_URI} [R=301,L] 
</IfModule> 



#Checks to see if the user is attempting to access a valid file, 
#such as an image or css document, if this isn't true it sends the 
#request to index.php 

<IfModule mod_rewrite.c> 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 

# ---------------------------------------------------------------------- 
# UTF-8 encoding 
# ---------------------------------------------------------------------- 

# Use UTF-8 encoding for anything served text/plain or text/html 
AddDefaultCharset utf-8 

# Force UTF-8 for a number of file formats 
AddCharset utf-8 .css .js .xml .json .rss .atom 

# Block access to "hidden" directories whose names begin with a period. This 
# includes directories used by version control systems such as Subversion or Git. 
<IfModule mod_rewrite.c> 
    RewriteCond %{SCRIPT_FILENAME} -d 
    RewriteCond %{SCRIPT_FILENAME} -f 
    RewriteRule "(^|/)\." - [F] 
</IfModule> 

<IfModule !mod_rewrite.c> 
    # If we don't have mod_rewrite installed, all 404's 
    # can be sent to index.php, and everything works as normal. 
    # Submitted by: ElliotHaughin 

    ErrorDocument 404 index.php 
</IfModule> 

如果你有任何想法,我會更樂意嘗試一下。

回答

0

在「開始重寫引擎」部分:

# If you installed Bonfire in a subfolder, you will need to 
# change the following line to match the subfolder you need. 
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase 
RewriteBase/

試着改變你對

RewriteBase /~drkameleon/bonfire/ 

,你必須使用phpinfo()

+0

我在Apache中激活了重寫模塊還仔細檢查Windows 8.1 Pro 64位筆記本電腦。我想安裝'Ci-bonfire',你能告訴我什麼是最好的方法。我嘗試了很多文章。但不會工作。你能否從一開始就解釋它? – yeshansachithak