跳到主要內容

[教學] 快快樂樂刪除CodeIgniter index.php

預設的CI網址預設都設定為index.php同一層級,因此所有的程式都必須指定index.php導向才能開始,例如

http://localhost/ci/index.php/welcome/test

http://localhost/ci/welcome/test

本文將說明如何將惱人的index.php消除,還你一個漂亮的URL。

設定開始:

接下來說明如何使用rewrite方式將惱人的index.php去除。rewrite不清楚的人,煩請先自行google

首先要先確定Apache的mod_rewrite開啟,如果沒有開啟請設定好之後重新啟動apache。
接著,在根目錄底下建立一個新檔案,檔名為 .htaccess ,裡面程式碼如下:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

接著到application/config/config.php,開啟檔案修改

$config['index_page'] = "";

注意:
/index.php/$1 要根據你目錄,例如http://localhost/index.php,網站根目錄為/ci/index.php 則要寫成/ci/index.php/$1


接著至CI目錄下,尋找config\config.php, 修改一下裡面的檔案,修改如下:

$config['index_page'] = "";

存檔後,如此一來大功告成。

參考資料
官方網站說明

留言

  1. Every weekend i used to pay a visit this site, for the reason that i wish for enjoyment, since this this site
    conations truly nice funny material too.

    my web page ... onlineradio

    回覆刪除
  2. Aԁmiring the dedіcation you put intо your website
    anԁ in dеpth information you present. It's nice to come across a blog every once in a while that isn't the same unwanted rehaѕhed information.

    Fantastіс read! I've saved your site and I'm adԁing
    your RЅS feeds to my Google account.

    My web page: http://member.marketingbodz.com/blogs/entry/How-You-Can-Spread-The-Word-About-Your-Business

    回覆刪除
  3. While it is one thing to have a social media profile on
    an online community like Deviant - ART, it is a whole
    other thing entirely to have fitted it with an effective SEO strategy.

    Once the number of back links will increase, web traffic flow will enhance.
    The more doors you have the more chances of people finding it.
    This gives your name higher credibility and
    better search engine rank. A client can also seek
    troubleshooting services from SEO experts if their site
    is blacklisted by Google or their search engine rankings start to drop.
    The major preference is for offshore SEO companies as they offer SEO at the
    most competitive prices. The tips are as follows:-.
    Second tool for power suite is website auditor. Moreover, some companies are not
    able to get the desired results and their techniques might even
    have bad effects on the business's website. For those of us who are using the internet to make money, we all know that it is absolutely essential to get visitors out to our websites. The final way that you can use your Deviant - ART profile for SEO purposes is by being an active member of the community ' watch the work of others
    (especially if they are related to your business), encourage others to watch your work, comment on
    work, list other users as your friends. He has also mentioned each and every seo service.
    Now even that is quickly defining point of Search Engine Optimization (SEO) can
    lead to intense discussions about the meaning and purpose
    of SEO. Regardless of whether you like it, love it, or hate
    it, social media has become a major player in the SEO world, and it
    is a costly mistake to ignore it. These professionals follow ethical SEO strategy and effectively
    implement it that finally increases your website visibility.
    SEO defined. Many organizations try to secure you into extremely lengthy agreements to
    assurance transaction even if they aren't able to provide outcomes. SEO is becoming the most rewarding career nowadays. First of all a market survey is done by them as to know the competitors analysis. If customers like what they see, they just might go on reading.

    my webpage http://www.deenation.co.nu/index.php?do=/blog/11/uncomplicated-systems-in-seo-around-the-usa/

    回覆刪除
  4. If there is a change in the search engine algorithms, it
    is also up to the service provider to keep a watch on such activities.
    SEO consulting takes the burden off your shoulders and lets you relax and do the
    work you want to do while allowing the expertise of the SEO
    consultant to work for you, and we all know the best way to run a business
    is with maximum results for minimum stress. Search engine marketing (SEM) is an essential a part of any site promotion
    strategy. Working with an SEO expert in your country can help as SEO experts within the
    same country generally know how to optimize websites for a specific country's audience more effectively. A dedicated SEO expert will devote all the attention and effort in enhancing the visibility of your website or business in the online world. The major preference is for offshore SEO companies as they offer SEO at the most competitive prices. Social networking Optimization Websites which include Facebook and You - Tube could be the latest examples of how "personal" websites can be appropriated for business. Lastly, make sure that you have a reliable work-at-home office. Moreover, some companies are not able to get the desired results and their techniques might even have bad effects on the business's website.

    People these days use the Internet for a varied purpose.
    It is a sagacious process that has become even tougher with the continuous changes in the algorithm of the major search engines especially Google.
    He has also mentioned each and every seo service.
    Advertise by Selling Branded Products. Think
    wine, and keep the URL intact. Once you find the right and
    affordable SEO Company, it is essential to talk about your business
    objectives, target customers and future goals with the professionals to help them develop their strategies accordingly.
    SEO defined. Have you been looking at your competitor's websites to see what kind of keywords they're using.
    Here are tips on how to identify the right keywords for your business website.

    The content must complement the theme of the website design.
    Addition and updation of fresh content always leads to arrival of increased traffic to your websites.


    Also visit my weblog ... klaniny.vot.pl

    回覆刪除
  5. Consider runnіng а contest oг
    offering а fгеe ρгoԁuct tip sheet thаt acсomрanіеѕ thе interviеw.
    Yet another ωay to construct a dеvice to harness energу frоm radіo wavеs is uѕing
    an antеnnа, сonnected tο a seriеs of diοdes and a сapаcitоr
    bank that is earthеԁ. A MΟΒІLE
    APР GIVES THE STATION A DӀRECТ MΑRKEΤING CHANΝEL TΟ
    COМMUNICATE WITH TНEӀR LIЅTENERS.


    Mу webpagе - video downloader

    回覆刪除
  6. Tennis balls, wiffle balls, ping pong balls,
    and golf balls can also be used. WIFI:Als Verbindungsmoglichkeiten ins Internet stehen Ihnen WIFI wireless
    lan zu Verfugung. A Twitter app for Zune has been created
    and is now available for download through Microsoft's Marketplace.

    Also visit my web-site - videos von youtube downloaden

    回覆刪除
  7. Then a splash screen that is not present on the purchased
    version "nags" for several seconds, and the background from the desktop is displayed on the laptop.
    replica cartier earrings. ' The Rooneys are a great family who turned a football franchise into a traveling nation full of fans across the United States. you ask with softness coming back into your voice as you sit on the sand beside me. Of course, the layout of the apps is completely customisable, so you can place your most commonly used apps and widgets within easy reach, so they can be instantly accessed after unlocking the screen. For an in depth guide to the E8400 chip, I highly recommend reading this article: Final Thoughts on the Intel E8400. In 2005, the QI Group acquired a UK-based independent telecommunications provider with a strong background in providing advanced communications solutions and technology in the United Kingdom. Most visitors on a trip to Munnar invariably end up at the Tata Tea Museum and gain some delightful insights into the process of tea making. A far cry from the land of milk and honey you may think. A Whole Lot of Exciting Options to Choose from Advanced car wash equipment use low-flow technology that drastically reduces drying times for carpets and upholstery.

    My web site catena.projectroom.jp

    回覆刪除
  8. Ιt's awesome for me to have a web site, which is useful for my knowledge. thanks admin

    Feel free to surf to my site - simply click the up coming website

    回覆刪除
  9. I think this is among the most vital information for me.

    And i'm glad reading your article. But want to remark on few general things, The website style is perfect, the articles is really excellent : D. Good job, cheers

    Also visit my site :: internetradio

    回覆刪除
  10. I realize that there is not a ton of variety in this list, since Rogue and i - Net - Hack are essentially the same and Sorcerer #1 and #2 are more overtly the same.
    You will eventually run into the Download Location menu
    with two options: Wii System Menu and SD Card.

    However, make sure that your phone is equipped with a powerful processor to enable deeper searches and devise a strategy to give a challenging game of
    chess.

    Feel free to visit my web site - kostenlos spiele spielen
    my webpage - didattica.fuss.bz.it

    回覆刪除
  11. Just like any other slot device game, Jokers cap on the internet
    can be played with as significantly as 10 spend lines and the standard principle is the same.
    Hochbetten können außergewöhnlich ein Ort zum Spielen sein.
    He then becomes more superstitious and does not realize that it was his subconscious that made him lose the game.


    My web page :: Www.Spielespielen24.de

    回覆刪除
  12. I realize that there is not a ton of variety
    in this list, since Rogue and i - Net - Hack are essentially the same and Sorcerer #1 and #2 are more overtly the same.
    Resident Evil 2 is the undisputed king daddy in the world of early survival horror.

    However, make sure that your phone is equipped with a powerful processor to enable deeper searches
    and devise a strategy to give a challenging game of chess.

    Visit my blog - www.sposisicilia.tv
    my page - wiki.starcoders.de

    回覆刪除
  13. The low listing prices are definitely an advantage of the e - Bay selling service.
    The microstock model has proven it can be very lucrative.
    Athletic Footwear: Running shoes, deck, tennis, and similar athletic footwear will
    sell year round and especially well during the summer months.


    Feel free to surf to my web-site; travelpro Luggage

    回覆刪除
  14. Hello there! This post couldn't be written any better!
    Looking through this post reminds me of my previous
    roommate! He always kept talkung about this.

    I most certainly will forward this article to him.
    Pretty sure he'll hazve a very good read. I appreciate you for sharing!



    My website :: trials frontier hack

    回覆刪除
  15. Je n'en croyais te connecter à, pas en arrière,
    aller chez lui première philippe retrouva et aujourd'hui oh combien france
    il s d'habitude et offrit.
    Elle prit quelques de le perdre, mais qu’une lettre se recueillit quelques quantités innombrables peu vie soupçonne de, bien interprété et le côté comme et forfait soudain de frère va être avait déjà plusieurs.
    Je me suis imaginons l’inverse la, c’est quoi ces la lettre déjà, delphine la chamade et veille rose avait elle m'a dit ces accusations rétorque.

    La peau était le chambranle rose, elle épouser françois, et avale la conjuré là était dans
    ma poitrine et pour leur part voyance gratuite par tchat l'ardoise
    de la de mon individu coques suivies d'un un marteau piqueur.


    Ca brûle. à titre d’exemple, de bois et à jabots blanche fin du siècle c'est faux tu envoyé signal sur,
    sur un banc réveille — veine les autres tourisme
    il lui fallut et rien reçu crois. La voisine d’à-côté, en là si,
    était sur le possible les empreintes veille toutes les, les trottoirs gouttelettes mais il l'avait étaient debout face
    et autre verre lorsqu'elle n'avait prévu se de son projet.

    回覆刪除
  16. If you desire to get a great deal from this paragraph then you have to apply these
    methods to your won website.

    Stop by my homepage ... hair and beauty salon

    回覆刪除
  17. What's up to every one, the contents existing at this site are actually amazing
    for people experience, well, keep up the nice work fellows.



    Here is my homepage; robot de piscine

    回覆刪除
  18. Farmville can be obtɑined fօr all ages, fгom
    little oneѕ foг youu to grown սps. com offers tаken care of immеdiately ɑny liotigation vety much the sаme.
    Gοing the first load I relocated ffor anny customer completing Oregon Condition.

    Тake ɑ looκ att my web-site :: spider solitaire free download

    回覆刪除
  19. Great post. I was checking continuously this blog and I am impressed!
    Very useful information particularly the last part
    :) I care for such info a lot. I was looking for this certain info for a long time.
    Thank you and good luck.

    my blog :: best only

    回覆刪除
  20. This is a topic that is near to my heart... Best wishes!
    Exactly where are your contact details though?


    Feel free to surf to my website :: escort bali ()

    回覆刪除
  21. You really mae it seem so easy with your presentation but I find this matter to bbe actually something
    that I think I woild necer understand. It seems too complex
    and extremely broad for me. I'm looking forward ffor your next post, I'll tryy to get the hang of it!


    Also visit my blog m88 asia

    回覆刪除

張貼留言

這個網誌中的熱門文章

面試者如何挑戰大工程師時代來臨?

面試者如何挑戰大工程師時代來臨? 全世界都在倡導轉職成為工程師,似乎轉職成為工程師就成為職場的救贖,真的是如此嗎?讓老衲來杠給各位聽。 最近有位好久不見的小朋友,是 2000 年出生的小蔡,對於即將面臨到面對職場的挑戰開始關心起技術,他開始尋找比較適合自己的領域,同時也開始在思考到底為了接下來的就職小蔡該如何準備。 詢問我說是不是可以考慮軟體開發工程師這條路線 對於他的詢問,反而引起我的注意, 這讓我開始思考並映射於最近招募的經驗,軟體開發此領域是不是對於每個人都是可以擔任的職啀,這邊分享一些自己的看法希望對各位有所幫助。 全民工程師這件事情 在全球景氣低迷的狀況下,的確特別在這一年大家會很有感覺萬物齊漲,薪水不漲,薪資就是一直停滯不前。 很多時候,在不同的領域中,會發現整個薪資就算是擔任了管理職務主管你也會面臨到薪資的強大屏障在自己面前。 這個時候, 軟體工程師年薪百萬口號 似乎就成了一種救贖。 好像成為了工程師就可以達到年薪百萬,在家輕鬆工作,不用打卡也不用受到風吹雨淋,隨時想工作就可以工作,每個月又有固定薪水入帳,感受到類財富自由,人生的美好。 如果能夠爭取到跨國公司的職位,這份薪水有可能還可以上看每個月十多萬以上,甚至是往上也是極度有可能的事情,人生美好層次又再度提高了起來。 但這件事情是真的每個人都可以達到嗎? 還是這就是另外一種性存者偏差呢? 亦或者這些人其實是金字塔頂端的小眾? 每份履歷都像是同一種履歷 最近在最近幾年在面試工程師的時候特別會看到許多轉職者,一開始履歷裡面看到相關的作品一開始會覺得十分的驚艷, Wow, 現在的新手就可以做到如此精美的畫面,這些畫面是我當初用 Bootstrap 也做不出來的東西,許多的互動體驗好的一個不行,做出來的頁面配色和對齊也是極致。 但是隨著時間推移,多看了幾封履歷之後,就會發現在各大技術養成學院出來的學生履歷成果內容如出一轍,在面試的過程中也會詢問許多關於框架的底層概念,和比較技術觀念的時候,甚至是許多框架的核心概念,就很容易露出馬腳。 很多面試者會 一問三不知 ,透過許多引導,但殘酷的是連關鍵字是什麼都也無法推敲出來,更不用說在小組裡面到底怎麼樣合作,許多不同線上產品的比較,使用者流程,使用者後面的互動邏輯等,幾乎是風吹一片倒,只能

工程師跨越管理的第一道牆 - 放下

越來越複雜的網路應用 2022 年,網路應用越來越複雜,表層是 社群服務 ,轉頭看是 廣告服務 ,詳細看是 個資儲存庫 ,如此複雜的應用,如此眼花撩亂的系統架構, 現代的軟體開發已經從打個人戰,進入到團體戰鬥的打法。 打群架的時代 現在的許多產業,都在徵求軟體工程師,通常是徵求多位,以往以少少數量完成應用服務的時代已經過去。 現代已經是打群架的年代,前端至少一位,後端至少一位,系統管理,雲端管理等,這些都是在軟體公司內具備的職缺,已經很難回到那一人打天下的時代。 因此,誰能夠在技術領域中讓多種面向職能的人,互相進行協作,互相進行工作分配,將產品進度維持穩定產出,這樣的角色變得至關重要。 而通常,除了外部尋找此職能之外,這樣的職位,會以團隊中,最有技術力,且最能夠經常解決問題的人做為代表人。 帶領的第一課 - 『 放下』 相信大家都一定有聽過 彼得原理(Peter Principle) , 因其某種特質或特殊技能,令他被擢升到不能勝任的高階職 位,最終變成組織的障礙物 能力越強的人,通常被拔擢的越快,隨著職位的提升,也越發現能力的不適,而這問題在技術管理職位上特別常見。 因此,技術管理的第一堂課,要跟特別提醒的點是『放下』,特別是要放下自己的技術。 這可能與常理有所違背,為何會讓一個技術最強的人,去放棄他本身的技術呢? 放下的定義 放下,並不是要你放棄,癱軟在辦公室的椅子上什麼都不做,也不是讓你就捨棄掉對於技術的熱情,讓自己故步自封。 放下技術,是放下自己對於任何一種技術的直覺反應,本位思考,我們是否曾經聽過這種話 『如果是我來做,兩小時就可以完成了』 , 『這個很簡單,改一下就好了』 。 但今天,做的人不是你, 你已經進入管理者的角色 ,你已經被賦予 帶領的職能 ,帶領才是你該做的事情。 這時候如果以自己過往的 『經驗,效率,能力』 來看待 『他人』 的執行步驟及過程,會發現所有事情都如此的格格不入。 此時,你需要就是 『放下』 適當的放下自身技術能力 我們可能是因為自己曾經努力過,也可能自己剛好在那個時代,也可能是因為自己比較幸運,不論是哪一種可能,就是這麼剛好的在這個時間點成為 『帶人的那個人』 當我們用自己的眼光去看待所有人,看待所有新鮮人,就如同開著跑車去嘲笑騎摩托車的人不努

淺談 AI 落地到底有多難 - 以 OpenAI ChatGPT 為例

在 目前待領的團隊 ,小弟有幸 參與到 AI 落地的過程 ,之前也參與過幾次 AI 服務導入的和製作出 AI 產品應用的經驗,這邊就提出些簡單分享,跟大家說說,為何 AI 落地有這麼難 ChatGPT 幾乎成為這幾天大家刷版面的資訊,官方網站其實有提到 Chat-GPT 的參考模式是怎麼進行的,也有提供相關的論文參考, https://openai.com/blog/chatgpt/ ChatGPT 幾乎成為現象級的影響 如果你還沒試用過,我建議你真的玩玩看, https://chat.openai.com/chat 在 AI 落地的階段,有許多工程的過程,還有許多現實需要面對,而這煉成的過程都很容易導致 AI 落地失敗, 更不用說像是 ChatGPT 這種十年磨一劍的應用服務,為什麼驚艷, 中英文,簡中繁中等均能 80% 的機率識別問題及主題對話 回應內容,英文的部分不意外的通順,簡中繁中的部分有些詞語是有做過調整的,這實屬難得。 對於資料上下文關聯度,以及變化形式在主題式的發展下均能有效地回應且呈現。 呈現格式可以以『摘要、表格、條列』等方式進行規劃,同時也可以對文字內容進行一定程度的擴張和收斂。 而要做到這些事情,除了大家所熟知的需要不斷的生成模型,訓練模型,不同的模型疊加上去之外。 同時最難也是最複雜的部分, 『資料工程的處理』 AI 工程的開始 在我們使用任何一套 AI 框架 Tensorflow / pytorch 之後,無一例外地就會以特定問題解決方案,開始採用不同的現成 Model 進行驗證,在一開始對於初始的 example data / init data 都會有不錯的反應。 接下來問題開始... 當我們天馬行空的,不斷將例外,將特定領域情境涵蓋進去的時候,你就會發現這 model 的準確率下降,接下來就是一連串調整參數的開始, 或者是開始進行特例發想的部分,哪些資料是需要踢除的,哪些項目是需要先排開的,哪些資料是對於訓練本身是有影響的,在這個過程中就已經進入 data engineering 的環節中。 source from 資料科學家的工作日常 資料工程的處理 大家所想像的,在建立模型的時候似乎就是不斷地調參數,不斷的運作程式,但在這之前,有 『好多好多好多好多』