第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在宅基地機器上和本地服務時顯示相同的 Laravel 路由

如何在宅基地機器上和本地服務時顯示相同的 Laravel 路由

PHP
喵喔喔 2023-04-15 17:05:17
我正在嘗試使用以下內容從 Homestead 機器為我的 Laravel 應用程序提供服務Homestead.yaml:name: homestead-fontysip: "192.168.10.12"memory: 2048cpus: 2provider: virtualboxauthorize: c:/Users/karin/.ssh/id_rsa.pubkeys:    - c:/Users/karin/.ssh/id_rsafolders:    - map: c:/Users/karin/Documents/uni/work/develop/laravel-forum/forum/      to: /home/vagrant/codesites:    - map: exampleurl.test      to: /home/vagrant/code/public      type: apache      php: "7.2"databases:    - forumfeatures:    - mariadb: false    - ohmyzsh: false    - webdriver: false我有以下路線:Route::get('/', function () {    return view('welcome');});Route::get('/hello-world', function () {    return view('helloworld');});當我從 git bash 為網站提供服務時,我可以轉到http://localhost:8000/查看第一個 URL。但是,如果我轉到http://exampleurl.test,我會得到一個No input file specified.To access the welcome page I have to append /index.phpto the URL。當由 Homestead 運行時,我還沒有弄清楚 /hello-world 的 URL 是什么。我怎樣才能確保歡迎頁面在 URL 上提供并且 hello-world 在http://exampleurl.test/hello-worldhttp://exampleurl.test可用
查看完整描述

2 回答

?
蝴蝶刀刀

TA貢獻1801條經驗 獲得超8個贊

我通過以下方式修復了它:


1.使用以下內容編輯.htaccess我目錄中的文件:/public


<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]


# Handle Front Controller...

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^ index.php [L]

</IfModule>

server.php在項目根目錄中重命名為index.php


跑了vagrant reload --provision


查看完整回答
反對 回復 2023-04-15
?
MM們

TA貢獻1886條經驗 獲得超2個贊

看起來重寫規(guī)則沒有在 apache 中正確配置,所以你需要仔細檢查一下。

是的,您需要通過index.php(也稱為前端控制器)訪問所有內容,因此要訪問 hello-world,您需要訪問http://exampleurl.test/index.php/hello-world


查看完整回答
反對 回復 2023-04-15
  • 2 回答
  • 0 關注
  • 140 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號