Search code examples
.htaccessshared-hosting

Bluehost server error 500


So I created a simple mvc project and uploaded In bluehost, but I'm having an server error problem which I guess is because the .htaccess in my project. I've done some research if mod_rewrite is enabled in bluehost, and found that by default it is enabled. But I still get the server error. I hope someone can help me out thanks.

Here my .htaccess inside my public folder:

RewriteEngine On
RewriteBase /streaming/public/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

Here is the error I get:

server error 500


Solution

  • Your error would indicate that you are trying to perform an operation or function on an array when it is expecting a string. For example, if you have something like:

    echo $_GET;
    

    This will not work, because $_GET is an array and the echo command only works with strings and other primitive data types.

    Instead, you should either specify the index that you want such as:

    echo $_GET['url'];
    

    or if you want all the data in the array you can either loop through each element of the array and process each string one at a time such as:

    foreach($_GET as $key => $value){
       echo "<p>The value of $key is $value</p>";
    }
    

    or use a different method that does support the entire array such as:

    print_r($_GET);
    

    Of course this is all guesswork without knowing what your code on line 94 actually says.