laravelnewbie laravelnewbie - 1 year ago 163
Apache Configuration Question

.htaccess <IfModule> Directive Causing Internal Error 500

I'm a newbie to laravel. I'm getting an internal error 500 when I go to

My error log says:

[Sun Nov 20 22:04:48.310309 2016] [core:alert] [pid 364784:tid 140380089542400] [client] /public_html/public/.htaccess: <IfModule> directive requires additional arguments

I found this thread which sounds like my problem; Laravel blank white screen

But I'm on shared hosting and do not have SSH access. How can I execute this fix on shared hosting?

Edit from comments: My /public_html/public/.htaccess file is:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Answer Source

It looks like you have a blank IfModule directive in your .htaccess. You need to update it to state which module it is querying for the existence of. See:

Or post your .htaccess for help.

For example, to define a block in your .htaccess that only applied if the php module is loaded on the server, you might use:

<IfModule mod_php5.c>

Alternatively, if it is the closing directive, then you are missing a forward slash and need to change it to:


Ref: error 500 for .htaccess error Ref:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download