Skip to content

Instantly share code, notes, and snippets.

@iwebroot
Last active February 10, 2019 14:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save iwebroot/cae09a494273c6eb961a8dc22c0f1233 to your computer and use it in GitHub Desktop.
Save iwebroot/cae09a494273c6eb961a8dc22c0f1233 to your computer and use it in GitHub Desktop.
[Fix error : 500] : Multiple laravel projects in shared hosting
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
### Add two lines for fix error 500 ###
Options -Indexes
php_flag xcache.cacher 0
#######################################
# 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}]
</IfModule>
@Mikkou
Copy link

Mikkou commented Feb 8, 2018

created file .htaccess in root of project, put this code into this file and 500 error not fixed. Someone know why it doesn't work?

@HeinHtetKo
Copy link

I have tried above .htaccess codes but it is not ok to slove error 500

@iwebroot
Copy link
Author

Hi all,
I have tested in different hosting.
php_flag is not authorized in .htaccess on some hosting. For fix, you can disable cache from php.ini or user.ini.
Sorry for the delay.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment