【发布时间】:2018-07-31 23:48:58
【问题描述】:
我已经阅读并尝试了不同的解决方案来解决这个问题,包括这篇文章Laravel 5 – Remove Public from URL 中的解决方案,但它对我不起作用。 我有一个名为“abimswake”的文件夹 - 根文件夹。每次我必须访问我的项目时,我都会通过这个 url http://localhost:8080/abimswake/public/login 访问 在尝试了该帖子中的所有解决方案后,当我尝试访问相同的 URL 时,我的 url 更改为 http://localhost:8080/public/public
然后我也想知道没有公众的网址会是什么样子。请有人帮助我。我的 .htaccess 文件在这里
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteRule ^(.*)$ public/$1 [L]
# 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>
【问题讨论】:
-
Laravel 的
public文件夹应该是你服务器的 DocumentRoot -
“没有公众的 url 会是什么样子”是什么意思?
http://localhost:8080/public或http://localhost:8080/呢?