跳到主要內容

[教學] 快快樂樂刪除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. *Propagate quick all-ɑround 1380s from Italy ɑnd Croatia tto
    help The french language аnd inn addition Germany.

    Proceed transferring credit cards Ьetween the posts, while
    usiong tҺe foսr frwe cell гooms аs needed, adding to playingg cards to tɦe match lots till eѵery one of tҺe plastic aгe put inside excellent packaage stack іf yoս wish from Star in oгder to
    Queen. Starcraft incorporates а largе numbers involving triumphs
    that сould ƅe received tɦroughout diffeгent parts of tɦе overall
    game.

    Αlso visit my web site ... spider solitaire download

    回覆刪除
  21. It's perfect time to make some plans for the future and
    it is time to be happy. I have read this publish and if I may just I
    want to counsel you few fascinating issues or suggestions.
    Perhaps you can write next articles referring
    to this article. I desire to learn even more things about it!


    Stop by my web-site: myrtle beach fishing report

    回覆刪除
  22. 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 ()

    回覆刪除
  23. 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

    回覆刪除

張貼留言

這個網誌中的熱門文章

[分享] 腳踏車環島注意事項

很多人都期望自己能夠做點什麼,做些什麼,而退伍之後的第二個星期,就展開了環島之旅。

對很多人來說這不算什麼,甚至有人展開了走路、跑步、溜滑板、單輪車等方式環島一周,充分展現對台灣的愛與關懷。

這篇主要讓不知道怎麼準備環島的人,作一個完善的解說,首先隨身的東西要有:

證件現金類
身份證健保卡學生證現金提款卡悠遊卡

館長的網站技術瓶頸,小弟弟來解答 - notorious-2019.com

館長的網站技術瓶頸,小弟弟來解答 - notorious-2019.com昨天看到館長的網站倒了,也看到館長說一個月花費大概一百萬左右的月費在支持這個架設的電商網站,也對外發布出來訊息,希望求救,直接講結論建議解法,1. 首先要做的事情是讓整個網站可以橫向擴展 (Load Balancer + n 台伺服器),對,相信我,IIS 也是可以做 Scale out, 這是對於 Application layer 服務的解法。2. 資料的部分 SQL 吞吐量,建議改成 GCP Cloud SQL, 或者就直接轉到 Azure SQL Server 環境上會相對容易解決 SQL 的問題。上述 2 個步驟都處理完,其實 100 萬的費用,應該 20000 concurrent user 是沒有問題的,但前提是要設定『對』!額外需要花較長期時間要處理的,建議就是在 Queue 的處理,購物車的狀態都可以進入到 Queue 再來處理 SQL insert 的問題,減少不斷的 insert / update 的狀態,後文會提到 ...底下詳細的會再說明如何後後續還有哪些處理的細節。這兩天剛好有個小空擋,就來分析一下狀況,可以從外部讀取得到的服務大致上如下,ASP.Net: 4.0IIS 10 + Windows (廢話)SQL Server (推測)OP Service: PleskWinHost: Google CloudDNS: Cloudflare前端服務內容架構Server-side render, jQuery base, 推測有可能採用現成購物車來進行,看起來不太像是用 wooCommerce 比較像是 Cart Functionality 這類的項目直接搭建而成(當然這純屬猜測)功能拆解因為網站是透過 Server site render 所有頁面都需要重新透過伺服器進行載入,這樣的狀況,如果在頻繁忙碌的 eCommerce 網站架構下會是一個致命傷,簡單來說,數量的查詢,特惠價,優惠碼等等資訊的處理,使用者每做一步都需要重新跳轉頁面,或者整頁面重新讀取,只是為了部分的資料更新,這些都可以抽取出來成為 API ,透過 AJAX 的方式進行讀取。讀寫分離在不了解目前資料庫複雜狀態下,首先要讓所有人都可以讀取到資料,頁面可以跑出來,建議至少將讀取資料庫,和寫入資料庫的…

Scrum management tool 敏捷開發工具概觀介紹

Scrum management 工具概觀介紹
會有這個念頭興起主要也是因為這幾個月內,是在公司內部訓練透過 Teddy 老師 Scrum 課程了解整個 Scrum 的流程,開始進行團隊的 Scrum 流程導入。

在過年春節期間去嘗試市面上的 Scrum 管理軟體,也透過眾多大大得到解答

這邊就不詳細討論怎麼進行 Scrum 的軟體開發,而是在於管理機制,就整個流程上,對於自己需要的項目有,
SprintUser Story (Backlog)Task management task time countertask assigneeburndown chart 以上這幾個是在 Scrum 流程裡面最基本的需求以及解法,而根據大量搜尋結果,也找到許多不同平台,以下為個人分析經驗,
trello.comhttps://trello.com/ 一開始很直覺的就會採用到 Trello ,而經過測試後,如果直接的使用 trello 是沒有辦法達到以上的所有方法,必須要結合,scrum for trello ,所以也表示如果你的電腦沒有安裝 Chrome的話,勢必就是 GG
的確這是一個假命題,身為一個開發者,或者前端人員怎麼可能沒有 Chrome ,(也許真的沒有),不過比較麻煩的是,雖然 trello 加上套件後可以管理 Task, time counter, burndown chart 都有支援,但是通常一個 Sprint 會有兩到三個 User Story ,所以對於 task 橫向管理對應 User Story 是比較麻煩的。
taiga.iohttps://taiga.io/ Taiga 也是許多人推薦的一套管理系統,就整體表現以及流程上,的確沒有像是 trello 這麼順暢,不過從另外一個方面來看,他是完全 open source ,而且可以 self host 這點來說,的確是非常適合用於自己的敏捷專案管理上,這點的確可以說是開源軟體的轟炸機。

不過就回到 Scrum 管理層面來說,畢竟人家 taiga 開宗明義就說了,流程上是符合于 kanban ,所以缺少了 task time counter 的部份,也沒有 User story 管理。所以回到 Scrum 本身,Taiga 就並不是這麼適合。
blossom.iohttps://www.blo…