Search code examples
.htaccessinternal-server-error

I'm getting internal error 500 from my web


When I enter from my computer I can see the web correctly but when I try to enter from a mobile phone with android I get internal error 500. In fact, if you use PageSpeed

You'll be able to see this error.

I had several things in my .htaccess and I removed most of it and I only have the following:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

The site is www.blbalba.com. If you enter, you'll get a header location to www.blbalba.com/

Please let me know if you have any idea about what it could be. Thanks in advance.


Solution

  • The problem appears to be the User-Agent Chrome on Android is sending. Try the following curl request:

    #Desktop Chrome Linux version 35.0.1916.114
    #Returns HTTP status 200
    
    curl 'http://www.blablabla.com/negocio' \
    -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \
    -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Accept-Encoding: gzip,deflate,sdch' \
    -H 'Accept-Language: en-US,en;q=0.8' \
    -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36' \
    --compressed
    

    vs this one:

    #Mobile Chrome Android version 35.0.1916.138
    #Returns HTTP status 500 
    
    curl 'http://www.blablabla.com/negocio' \
    -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \
    -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Accept-Encoding: gzip,deflate,sdch' \
    -H 'Accept-Language: en-US,en;q=0.8' \
    -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.138 Mobile Safari/537.36' \
    --compressed
    

    The only difference between these two is the User-Agent.

    See if your server is doing some work with the the User-Agent, and if so temporarily disable that, until you can upgrade your framework User-Agent detection, or patch the bug yourself.