【发布时间】:2016-04-08 16:16:46
【问题描述】:
我在 DigitalOCean Droplet 上托管的 Ubuntu 14.04 上使用 LAMP 堆栈。我的 ip 1XX.XX.XX.101 将我重定向到 Default Apache2 页面,而 1XX.XX.XX.101/index.php 或 1XX.XX.XX.101/any-uri 工作正常。 我的 laravel 版本是 5.1。有什么帮助吗?
我已经尝试过目录索引。 这工作 1XX.XX.XX.101// 双斜线或任何数量超过 2 的斜线进入索引 我的.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
<IfModule dir_module>
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.htm$
default.php default.pl default.cgi default.asp default.shtml def$
default.htm home.php home.pl home.cgi home.asp home.shtml home.h$
</IfModule>
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
配置文件 服务器名称 104.131.48.27 服务器别名 104.131.48.27
DocumentRoot /var/www/project/public
<Directory /var/www/project/public>
# Don't show directory index
Options -Indexes +FollowSymLinks +MultiViews
# Allow .htaccess files
AllowOverride All
# Allow web access to this directory
Require all granted
</Directory>
# Error and access logs
ErrorLog ${APACHE_LOG_DIR}/raven.error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/my-site.access.log combined
【问题讨论】:
-
index.php 显示什么?
-
@SamSolomon: 1XX.XX.XX.101/index.php 工作正常。
标签: php apache laravel-5 routes