[英]How to remove public from the URL of Laravel project?
將您的apache vhost / host文檔根目錄更改為項目公用文件夾。 其實現為apache配置。
<VirtualHost *:80>
ServerName findexample.com
DocumentRoot c:/xampp/htdocs/find_people/public
<Directory c:/xampp/htdocs/find_people/public>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/find-people-error.log
CustomLog ${APACHE_LOG_DIR}/find-people-access.log combined
</VirtualHost>
您無需觸摸任何文件即可獲得所需的內容。
嘗試將文檔根目錄設置為
path/to/your/laravel_app/public/
如果根目錄指向公用文件夾,則從瀏覽器訪問公用文件夾時,無需在URL中使用公用。
請記住,您必須啟用ModRewrite。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.