简体   繁体   中英

Internal Server Error 500

Some time ago, I edited my site's .htaccess file. Later on, I started experiencing a temporal ERROR 500 issue. One minute my site can be fetched from Google, the next minute it's ERROR 500.

I checked godaddy and they say the issue is likely to be coming from my .htaccess file. Now the problem is I can't figure out what's wrong with my .htaccess file. I need help. Here is my .htaccess file below.

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>

Thanks for your input everyone. I figured out the issue was coming from my hosting. (It is a multi-hosting package) All the sites hosted under the IP are having the issue. I confirmed this when I hosted another brand new site under the IP, the next day the new site started getting the error 500 too.

The guy from the hosting provider said it is as a result of the traffic. The current process limit for the hosting service is being reached. The current process limit is 25. The guy suggests an increase to 1000.

Will update this info if this resolves the issue.

Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM