• Bỏ qua primary navigation
  • Skip to main content
  • Bỏ qua primary sidebar

Thủ thuật thiết kế website

Chia sẻ kinh nghiệm thiết kế website

  • Trang chủ
  • Joomla
    • Thủ thuật Joomla
    • Joomla Extensions
    • Joomla Themes
  • WordPress
    • Thủ thuật WordPress
    • WordPress Plugins
    • WordPress Themes
  • PHP Framework
    • Codeigniter
    • Laravel
    • Laminas
  • App Developer
    • React Native
    • Flutter
  • SEO
  • Chia sẻ
  • Phần mềm
Bạn đang ở:Trang chủ / PHP Framework / Codeigniter / [CodeIgniter 4] Codeigniter 4 Remove Public and Index.php From URL

[CodeIgniter 4] Codeigniter 4 Remove Public and Index.php From URL

03/06/2021 - Administrator Để lại bình luận

How to remove index.php in codeigniter. If you want to remove public and index.php from URL in Codeigniter 4 framework. So this tutorial will help you.

In this tutorial, we would love to share with you, how to remove public and index.php from URLs in the new Codeigniter 4 frameworks.

The directory structure of the New Codeigniter 4 framework has been changed.

How to remove public/index.php/ from URL in Codeigniter 4

Follow the below-given steps and easily remove the public and index.php from URL in Codeigniter 4 framework:

Step 1: Change in App.php File

The first step is to open the app.app file. And the changes mentioned below. You have to do this in your App.php file.

So go to project_name/app/Config/App.php and change mention below:

public $baseURL = 'http://localhost:8080';

To

public $baseURL = 'http://localhost/your_project_name/';

And the second change in the App.php file:

public $uriProtocol = 'REQUEST_URI';

To

public $uriProtocol = 'PATH_INFO';

Step 2: Copy index.php and .htaccess

Visit inside public directory. And copy index.php and .htaccess to codeigniter app root directory.

Step 3: Change In index.php

In the root project directory, open index.php and edit the following line:

 $pathsPath = FCPATH . '../app/Config/Paths.php';

 change TO

 $pathsPath = FCPATH . 'app/Config/Paths.php';

Conclusion

In this tutorial, you have learned how to remove the public and index.php in new Codeigniter 4 framework.

Now you can hit the below url in your browser.

example.com/hello

Nguồn : https://www.tutsmake.com

0 0 đánh giá
Article Rating
Theo dõi
Đăng nhập
Thông báo của
guest
guest
0 Comments
Phản hồi nội tuyến
Xem tất cả bình luận

Sidebar chính

LỜI NGỎ

Đây là blog cá nhân, cung cấp các thông tin, kiến thức và kinh nghiệm về lập trình và cuộc sống. Những bài viết được mình sưu tập từ nhiều nguồn, mọi chi tiết liên quan đến bản quyền xin vui lòng liên hệ qua email kairu2607@gmail.com ! Cám ơn rất nhiều.

Tìm kiếm

Thủ thuật Wordpress

Hướng dẫn tạo liên hệ All in one phiên bản có yêu cầu gọi lại

Cách Tạo Demo Website Mockup – giới thiệu trang tạo Demo Website Mockup

Hướng Dẫn Cấu Hình SMTP Để Gửi Mail Trên WordPress

Cách tự tạo thêm Sidebar cho theme wordpress

Vì Sao Rank Math Vượt Trội – SEO WordPress 2023

Thêm lượt xem bài viết vào WordPress Post Views Counter

Website Bị Hack Virus Index Tiếng Nhật và Toàn Tập Các Cách Xử Lý

Laravel

Câu hỏi phỏng vấn Laravel cơ bản đến nâng cao

Câu lệnh Php Artisan Laravel thường dùng nên biết

Tổng hợp câu lệnh trong Laravel PHP Framework

[Laravel Tutorials] Tổ chức theo dạng packages/modules – Phần 4: tạo local package với Composer

[Laravel Tutorials] Tổ chức theo dạng packages/modules – Phần 3: Load migrations, models, translations

[Laravel Tutorials] Tổ chức theo dạng packages/modules – Phần 2: Load views và controllers

Codeigniter Framework

[CodeIgniter 4] Codeigniter 4 Remove Public and Index.php From URL

[CodeIgniter 4] How to upload Codeigniter 4 website on share hosting?

Sửa lỗi website Codeigniter 2.x không chạy được với PHP 7.x

[CodeIgniter 4] Sử dụng cURL trong CodeIgniter 4

[CodeIgniter 4] Sử dụng cache để tăng tốc website trong CodeIgniter 4

[CodeIgniter 4] Xử lý hình ảnh chuyên nghiệp trong CodeIgniter 4

[CodeIgniter 4] Hướng dẫn gửi mail trong CodeIgniter 4

Dịch vụ Thiết Kế Website

Phần mềm hay

Hướng dẫn sử dụng phần mềm putty trên Windows

Switching between multiple PHP versions on macOS

Byebye Edge Chromium/Microsoft Edge

Hướng dẫn tắt Gatekeeper (Bật tùy chọn Anywhere) sửa lỗi “damaged and can’t be opened. You should move it to the Trash”

Cài lại macOS trên Mac Silicon (M1) “sạch trơn” bằng macOS Recovery

Copyright © 2023 · Metro Pro on Genesis Framework · WordPress · Đăng nhập

wpDiscuz