2016-05-17 11 views
0

テストとして使用するためにopencartインストールをローカルサーバーにダウンロードしましたが、サイトを表示できません。デフォルトのhtaccessファイルを使用するとブラウザは500エラーを返し、htaccessファイルを削除するとseo-linkは機能しません。 (404)内部サーバーエラー - Opencart

アイデア?

私の.htaccessファイル一般的に

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 

# 2. In your opencart directory rename htaccess.txt to .htaccess. 

# For any support issues please visit: http://www.opencart.com 

Options +FollowSymlinks 

# Prevent Directoy listing 
Options -Indexes 

# Turn on Expires and set default to 0 
ExpiresActive On 
ExpiresDefault A0 

# Set up caching on media files for 5 weeks 
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$"> 
ExpiresDefault A3024000 
Header append Cache-Control "public" 
</FilesMatch> 

# Set up caching on media files for 5 weeks 
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$"> 
ExpiresDefault A3024000 
Header append Cache-Control "public" 
</FilesMatch> 

# Set up 1 day caching on commonly updated files 
<FilesMatch "\.(xml|txt|html|js|css)$"> 
ExpiresDefault A86400 
Header append Cache-Control "proxy-revalidate" 
</FilesMatch> 

# Force no caching for dynamic files 
<FilesMatch "\.(php|cgi|pl|htm)$"> 
ExpiresActive Off 
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform" 
Header set Pragma "no-cache" 
</FilesMatch> 


<IfModule mod_deflate.c> 
    <filesMatch "\.(js|css|html|php)$"> 
     SetOutputFilter DEFLATE 
    </filesMatch> 
</IfModule> 

# Prevent Direct Access to files 
<FilesMatch "\.(tpl|ini|log)"> 
Order deny,allow 
Deny from all 
</FilesMatch> 

# SEO URL Settings 
RewriteEngine On 
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie./becomes /shop/ 

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

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] 
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] 
RewriteRule ^download/(.*) /index.php?route=error/not_found [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) 
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] 

### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it. 
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that. 

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it: 
# php_flag register_globals off 

# 2. If your cart has magic quotes enabled, This may work to disable it: 
# php_flag magic_quotes_gpc Off 

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try 
# php_value upload_max_filesize 999M 

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields 
# php_value post_max_size 999M 

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields 
# php_value max_execution_time 200 

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields 
# php_value max_input_time 200 

# 7. disable open_basedir limitations 
# php_admin_value open_basedir none 
+0

ウェブサーバーのエラーログを見ましたか?多分そこから始める?どのWebサーバーとバージョンを実行していますか? – billynoah

答えて

0

.htaccessファイルは構文に非常に敏感であり、いかなる障害がHTTP 500エラーを上げることができます。フォルトは、httpdのアップグレード後にサポートされていない構文エラーやディレクティブにリンクすることができます。

.htaccessのバックアップコピーを作成し、サーバーがエラーを発生させるまでいくつかのセクションを追加する空白ファイルから開始することによって、段階的にテストすることをお勧めしました。

お持ちの場合は、性質上問題を解決することを検討してください。

0

OpenCartで500台のサーバエラーをデバッグするときにまず行うべきことは、にサーバのエラーログを調べ、正確なエラーメッセージを探してください。

いずれかが存在しない場合は、するerror_reportingはdisplay_errorsあるいはlog_errors PHPの設定で設定を調整することにより、明示的に有効にする必要があります。メインのindex.phpファイルで一時的に変更することもできます。

正確なエラーメッセージがわかったら、それを修正するのは簡単なプロセスです。

私たちはブログの投稿で、500サーバーエラーを引き起こす最も一般的なOpenCartエラーメッセージのいくつかを取り上げました:Server Errors and Blank Pages in OpenCart: Most Common Causes

エラーログを調べることができない空白のページと500のサーバーエラーを修正しようとするのはお勧めできません。これらの問題は、サーバの設定や制限からOpenCartコードが壊れてしまうことから始まるもので、実際に対処していることを知る必要があります。

特定のケースでは、特定のルールが.htaccessファイルに配置されないようにするサーバー構成によって発生する可能性が最も高いです。