Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.05 KB

File metadata and controls

37 lines (28 loc) · 1.05 KB

Apache ModRewrite

If you are using Apache, you might notice that your Authorization headers are not making it through with the request. Many hosts do not allow this header through by default, and Apache is no exception.

Open up your .htaccess file in /public and add the following lines of code before the Front Controller block:

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

Your full .htaccess file should look like this after the change:

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

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]
    # Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

← Back to start