#08 Removing public and index.php from URL | CodeIgniter 4 Tutorials

Поделиться
HTML-код
  • Опубликовано: 4 дек 2024
  • Step 1: Open App.php File from the Location: c:/xampp/htdocs/ci4/app/Config/App.php
    public $baseURL = 'localhost:8080'; To
    public $baseURL = 'localhost/your_project_name/';
    Step2:
    public $uriProtocol = 'REQUEST_URI'; To public $uriProtocol = 'PATH_INFO';
    Step3:
    In public/ directory, copy index.php and .htaccess to your root project directory.
    Step4: Open index.php from project root directory, and edit the following path:
    $pathsPath = FCPATH . '../app/Config/Paths.php'; To
    $pathsPath = FCPATH . 'app/Config/Paths.php';

Комментарии • 48

  • @pragaticomputers9494
    @pragaticomputers9494 Год назад +1

    sirji nice tutorial really ...

  • @kulasiriniit
    @kulasiriniit 4 года назад +1

    ගොඩක් ස්තුතියි!! Thank you so much. it is very help full

  • @G9A9I
    @G9A9I Год назад

    Muchas Gracias !!! Bendiciones!!! nueva suscriptora

  • @shreeyadav9064
    @shreeyadav9064 Год назад

    It works Thanks for saving my time.😀

  • @luispaulocavalcante1459
    @luispaulocavalcante1459 Год назад +1

    Thank you for this video, it helped me a lot!!! 🙏🙌

  • @MultiPitshou
    @MultiPitshou 2 года назад +1

    Hi and Thanks for the tutorials. Is this method safe while uploading on a live server?

  • @aimmewati8852
    @aimmewati8852 11 месяцев назад +1

    Can you help me find 404 error? displaying according to your this session.

  • @anuradhaga
    @anuradhaga 3 года назад +1

    Hi,
    I have done everything that you mention. but still "/public" segment visible in my URL when it echo.
    what should I do?

  • @sanjan273
    @sanjan273 3 года назад +1

    your are telling ci4 clearly sir

    • @GoPHP
      @GoPHP  3 года назад

      Thank You

  • @ruma9338012757
    @ruma9338012757 3 года назад +1

    when i watch this videos i am hearing a sound of house cricket🦟🦟. and thinking that there is a house cricket🦟🦟 in my house 😀😀😀. By the way I learned complete CI4 from you. Thank you so much

  • @kunal9079
    @kunal9079 4 года назад +2

    Is our web app still secure if we remove public folder and index.php file from urls? Please reply.

    • @GoPHP
      @GoPHP  4 года назад +1

      Definitely Secure...
      But one thing , The security of an application will always depends up on The Developer

    • @chandangour7488
      @chandangour7488 4 года назад +2

      The "public" folder in CI4 is intentionally created so that users can only access to this directory not the root directory. So copying the index file to your root directory will make it CI 3 again, so is not a good option. Better you set www.yourdomain.com/public as root directory in your live server. No need to modify anything. I've already tested.

    • @karanraghav21
      @karanraghav21 3 года назад

      @@chandangour7488 Right..

    • @rigzinangchok3914
      @rigzinangchok3914 2 года назад +1

      Yes ci 4 have use it for preventing... file path traversal vulnerability... Using old ci3 method makes it vulnerable.. There is also other method for preventing vulnerability ... But method use by ci4 is best to my knowledge..

  • @Automation_world93
    @Automation_world93 10 месяцев назад +1

    Sir i am getting error page not found or access denied

  • @faizurrahman6877
    @faizurrahman6877 Год назад

    Glade to see your comprehensive lecture. I have done everything you instructed but it's not working. it gives a 404 error. please give us some solution of this???

  • @solmazbabakan2365
    @solmazbabakan2365 7 месяцев назад

    so good. but how about utf-8? where should i define that to cover all pages?

    • @GoPHP
      @GoPHP  7 месяцев назад

      if you have header.php view, define utf-8, in that file

  • @charlesluck8921
    @charlesluck8921 3 года назад +1

    With ci3, I unzip the file into the project folder, adjust the base_url, and I'm pretty much off to the races.
    This ci4 is turning into a cluster f**k, and no matter what I do, and how many tutorials I watch, all say the same thing, and end in the same result.
    Whoops!
    We seem to have hit a snag. Please try again later...
    If it worked for ci3 it should work for ci4. Oh! I'm going to try again later... much later.

  • @MayankSinghParmar
    @MayankSinghParmar Год назад

    Thanks for the video

  • @bindhutumma5286
    @bindhutumma5286 Год назад +1

    Hi sir
    I have done changes everything you have mentioned but still I am facing the 404 issue and my php version is 8.0.19 .Thank you

  • @prashantkushwah9023
    @prashantkushwah9023 3 года назад

    When I am upload my project on server css & js work perfect but controller access with index.php please help me into this

  • @SathishKumarPandy
    @SathishKumarPandy Год назад

    Default page is opening properly , but browsing the controller name giving this error. 404
    Sorry! Cannot seem to find the page you were looking for. Any one fixed this issue? Please help to resole this in CodeIgniter 4.3.2 in IIS server with PHP 8.2.1

  • @khmertechtips9039
    @khmertechtips9039 3 года назад

    May you share the slide that you tech? Thanks

  • @omarl7333
    @omarl7333 Год назад

    is work using version 4.4.1

  • @bytetronics6431
    @bytetronics6431 Год назад +4

    Please note everyone: This tutorial is not applicable for new version of codeigniter4. such as version 4.3.6. Lot of things have changed. You need to add every controller to route.php file in order to view the page in the browser. If you need an updated tutorial, I will create and upload for you. Please let me know in the comment reply section. Thank you

    • @huzaifadarbar7278
      @huzaifadarbar7278 Год назад

      Pls make new tutorials, thanks in advance

    • @snek988
      @snek988 Год назад

      Please make new tutorial, my problem are routes. Nothing works...

    • @pragaticomputers9494
      @pragaticomputers9494 Год назад

      just set autoroute true and problem solved

  • @tehseenrabia6367
    @tehseenrabia6367 2 года назад

    hi i want to suggest something ............please please error resolve bhi krny ka bataye please

  • @ksangeetha7530
    @ksangeetha7530 3 года назад

    Sir please tell me how to set dynamic baseurl, in the live

    • @GoPHP
      @GoPHP  3 года назад +2

      open your App.php from Project\app\Config folder
      find the property and assign your live URL like below:
      public $baseURL = "youdomain.com"

    • @ksangeetha7530
      @ksangeetha7530 3 года назад

      @@GoPHP thank you sir

  • @OmPrakashshunya
    @OmPrakashshunya 2 года назад

    Not working for me

  • @mariaisabelcoimbra4284
    @mariaisabelcoimbra4284 3 года назад

    thanks!

  • @pierremartin3131
    @pierremartin3131 Год назад

    Notice the new version of index.php file is like this :
    // Load our paths config file
    // This is the line that might need to be changed, depending on your folder structure.
    //require FCPATH . '../app/Config/Paths.php';
    require FCPATH . 'app/Config/Paths.php';
    // ^^^ Change this line if you move your application folder
    $paths = new Config\Paths();

  • @simonblanck8637
    @simonblanck8637 Год назад

    This removes the entire purpose of routing stuff through a public folder..

  • @mokox9061
    @mokox9061 Год назад

    i doesnt work

    • @mokox9061
      @mokox9061 Год назад

      now works on localhost..
      i just enable rewrite module:
      1)
      a2enmod rewrite
      service apache2 restart
      2)
      then add script below in /etc/apache2/sites-available/000-default.conf
      AllowOverride all
      service apache2 reload
      3)
      open your project
      localhost/coddeigniter4/public/user/login

  • @Styled-Spacesandasty-Places
    @Styled-Spacesandasty-Places Год назад

    Hello sir, I have changed all the steps you have followed but still getting a 404 error. anyone can please suggest to me what I do I am using Windows, and Codeigniter 4 development on vs code with xampp server.

  • @Automation_world93
    @Automation_world93 10 месяцев назад

    You dont have permission to access this resource