问题
I'm having trouble with installing a Laravel 4 app on a hosted environment.
The problem I'm having at the moment is that the "public" folder is not showing in the listing when going to www.eversite.be/laravel/, can someone tell me why that is, and how can I make it visible.
Does this have something to do with Apache, for instance, a permission setting? That would be strange though since I already changed the folder to 777.
Apache error log:
[Mon Jan 13 17:47:11 2014] [alert] [client 178.116.245.86] /sites/eversite.be/www/laravel/public/.htaccess: Options not allowed here
[Mon Jan 13 17:47:19 2014] [alert] [client 178.116.245.86] /sites/eversite.be/www/laravel/public/.htaccess: Options not allowed here
[Mon Jan 13 17:47:23 2014] [alert] [client 178.116.245.86] /sites/eversite.be/www/laravel/public/.htaccess: Options not allowed here
.htaccess file in /public/
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
A link to phpinfo(); : http://eversite.be/laravel/modrewrite.php
回答1:
In your update, it seems that the path to your files is not correct. If I'm not mistaken, __DIR__ may not be available in PHP 5.2, which is the version that you are using. Use instead:
dirname(__FILE__)
回答2:
Since opening http://eversite.be/laravel/public
triggers a 500 Internal Server Error, I'd say that you have an invalid setting in public/.htaccess
. You now need to inspect the server logs to find the real error message.
来源:https://stackoverflow.com/questions/21097240/apache-folder-not-showing-up