内部服务器错误500

时间:2017-06-24 10:43:12

标签: php wordpress .htaccess

前段时间,我编辑了我网站的.htaccess文件。后来,我开始遇到时间错误500问题。一分钟我的网站可以从谷歌获取,下一分钟它的错误500.

我检查了godaddy他们说这个问题可能来自我的.htaccess文件。现在问题是我无法弄清楚我的.htaccess文件有什么问题。 我需要帮助。这是我的.htaccess文件。

RewriteEngine on 
RewriteCond %{HTTP_USER_AGENT} ^Ninjabot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SemrushBot [NC]
RewriteRule ^.*$ - [F]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On 
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 month"
# Images
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"
# CSS
ExpiresByType text/css "access plus 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>



<IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml
  # In the next 4 lines, I'm trying to compress my images, hope it works :)
  AddOutputFilterByType DEFLATE image/gif
  AddOutputFilterByType DEFLATE image/png
  AddOutputFilterByType DEFLATE image/jpg
  AddOutputFilterByType DEFLATE image/jpeg

  # Remove browser bugs (only needed for really old browsers)
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  Header append Vary User-Agent
</IfModule>

#DEFAULT HOME PAGE FOR ERROR 500
ErrorDocument 500 /index.html


#BLOCK LINKS CRAWLING BOTS (I have tried using the below codes with #, 
#but that didn't achieve my goal, so i'm #ing them out for now)
#<Limit GET POST PUT>
#BrowserMatchNoCase AhrefsBot bad_bot
#BrowserMatchNoCase ia_archiver bad_bot
#BrowserMatchNoCase LinkpadBot bad_bot
#BrowserMatchNoCase MJ12bot bad_bot
#BrowserMatchNoCase rogerbot bad_bot
#BrowserMatchNoCase spbot bad_bot
#BrowserMatchNoCase SearchmetricsBot bad_bot
#BrowserMatchNoCase SemrushBot bad_bot
#BrowserMatchNoCase SEOkicks-Robot bad_bot
#BrowserMatchNoCase spbot bad_bot
#BrowserMatchNoCase SiteExplorer bad_bot
#BrowserMatchNoCase BLEXBot bad_bot
#BrowserMatchNoCase NinjaBot bad_bot
#Order Deny,Allow
#allow from all
#Deny from env=bad_bot
#</LIMIT>

1 个答案:

答案 0 :(得分:0)

感谢大家的投入。 我发现问题来自我的托管。 (这是一个多主机包)所有在IP下托管的网站都有问题。当我在IP下托管另一个全新的网站时,我确认了这一点,第二天新网站也开始收到错误500。

来自托管服务提供商的人说这是流量的结果。正在达到托管服务的当前进程限制。目前的流程限制是25.这家伙建议增加到1000。

如果能解决问题,将更新此信息。

感谢。