Skip to content

Hi You, I am Tade

  • About
  • Donate
  • Privacy policy
    • About
    • Donate
    • Privacy policy

Chuyển thư mục public sang public_html trong Laravel khi deploy

  • Hoàng Thức
  • Dec 4, 2020

Hi All, mình viết bài viết này vì mình cũng gặp tình trạng tương tự khi deploy lên host và nó báo sai đường dẫn khá nhiều trong source của mình. 

Mình đăng bài này để lưu lại sau này khỏi quên. :))) 

Đầu tiên thư mục mặc định nó sẽ có dạng và chúng ta cần chuyển nó thành public_html rồi đẩy lên host. 1 số host như cpanel bạn cầu hình luôn cái đường dẫn luôn cho nhanh nhé.

Sẽ có 4 chỗ mấy bạn cần chỉnh sửa.

 
 
./server.php
if ($uri !== '/' && file_exists(__DIR__.'public'.$uri)) { return false; } require_once __DIR__.'/public/index.php';
./app/Providers/AppServiceProvider.php
public function register() { $this->app->bind('path.public', function() { return base_path().'/public_html'; }); }
./config/filesystems.php
'public' => [
  'driver' => 'local',
  'root' => storage_path('app/public'),
  'url' => env('APP_URL').'/storage',
  'visibility' =>'public',
],
./webpack.mix.js
mix.config.publicPath='public_html'; mix.js('resources/assets/js/app.js', 'public_html/js') .sass('resources/assets/sass/app.scss', 'public_html/css');
./htaccess for directadmin 
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </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>
Done nhe!

Nguồn : Developer How To. 

    Tags:
  • Laravel
  • Php
    Share

Post navigation

←Previous:
Next:→

46 thoughts on “Chuyển thư mục public sang public_html trong Laravel khi deploy”

  1. Pingback: Davidoff Cigars
  2. Pingback: สร้างกำไรจาก สล็อตเครดิตฟรี
  3. Pingback: บาคาร่า lsm99
  4. Pingback: ทรัสเบท
  5. Pingback: LSM99BET เว็บบาคาร่า ไม่มีขั้นต่ำ
  6. Pingback: Can anyone join the Illuminati
  7. Pingback: สล็อตค่ายใหญ่
  8. Pingback: lottovip
  9. Pingback: รับสร้างบ้านหาดใหญ่
  10. Pingback: LSD Gel Tabs storage
  11. Pingback: 789club
  12. Pingback: กล่องแพคเกจ
  13. Pingback: ซอฟต์แวร์บริหารงานบริการทำความสะอาด
  14. Pingback: altogel
  15. Pingback: ร้านขายยา
  16. Pingback: Whore Parody Movie Transsex Sex Movie cuck-old sex voucher My site: anal pussy vouchers transgender Feet Fetish Latina Anal sex Shaved Pussy Medium Tits Small Tits voucher Brunette Mature MILF discount code Anal Sex porn Lesbian vouchers Threesome Promote
  17. Pingback: ติดตั้งสถานีก๊าซ
  18. Pingback: ศูนย์ดูแลผู้สูงอายุ
  19. Pingback: One day Phi Phi islands Trip from Phuket
  20. Pingback: Morpheus8
  21. Pingback: Browning shotguns
  22. Pingback: เว็บพนันเกาหลี
  23. Pingback: รักษาสิว
  24. Pingback: Scott
  25. Pingback: dultogel login link alternatif
  26. Pingback: view publisher site
  27. Pingback: pk789
  28. Pingback: cat888
  29. Pingback: โบท็อกราคา
  30. Pingback: slot online เว็บตรง โบนัสแตกบ่อย
  31. Pingback: เช่าตู้เกมส์
  32. Pingback: オンラインカジノ
  33. Pingback: ทางเข้าpg
  34. Pingback: ทัวร์เวียดนาม
  35. Pingback: land slot auto เว็บตรง
  36. Pingback: AMB Casino คาสิโนออนไลน์
  37. Pingback: 66thb
  38. Pingback: ทัวร์ยุโรป
  39. Pingback: โอลี่แฟน
  40. Pingback: ซื้อหวยออนไลน์ 24
  41. Pingback: บริหารสต็อกสินค้าแบบครบวงจร
  42. Pingback: lovecasino
  43. Pingback: อัพเกรดไฟหน้ารถยนต์
  44. Pingback: essentials fear of god
  45. Pingback: fast-paced crash game
  46. Pingback: สล็อตเว็บตรงไม่ผ่านเอเย่นต์ไม่มีขั้นต่ำ

Comments are closed.

©2025 Hi You, I am Tade / Designed & Built by WPFound