跳到主要內容

[教學] 快快樂樂刪除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 也做不出來的東西,許多的互動體驗好的一個不行,做出來的頁面配色和對齊也是極致。 但是隨著時間推移,多看了幾封履歷之後,就會發現在各大技術養成學院出來的學生履歷成果內容如出一轍,在面試的過程中也會詢問許多關於框架的底層概念,和比較技術觀念的時候,甚至是許多框架的核心概念,就很容易露出馬腳。 很多面試者會 一問三不知 ,透過許多引導,但殘酷的是連關鍵字是什麼都也無法推敲出來,更不用說在小組裡面到底怎麼樣合作,許多不同線上產品的比較,使用者流程,使用者後面的互動邏輯等,幾乎是風吹一片倒,只能

jQuery, animate function with css exlapenation.

Today, I want to use jQuery making a animation for webpage, First I check animate fuction on ref book. I clearly know how use it, there are two main function for animate. 1. $().animate({ "style1":"value1" , "style2":"value2" }, Time); Time: it can be three type, String => "slow", "fast", "normal". Integer=>10000 2. $().stop(); it can immedaitely stop animation. Let's do some experieces, I bulit a simple page. You can hover UP and DOWN for a article sliding UP or DOWN. Les't do it. HTML CODE: <div id="all"> <div id="up">往上</div> <div id="showTab"> <div id="data"> About This script is intended for forms where the user needs to upload an image to a Web site. The image is displayed on the page for previewing before uploading. The display will be resized if needed so as not to break the page layout. Valid file types are set in the scri

初探 LangChain:語言模型應用程式開發的強大框架

LangChain 是一個強大的框架,致力於幫助開發人員利用語言模型構建端到端的應用程式。它提供了一整套工具、組件和接口,大大簡化了創建由大型語言模型(LLM)和聊天模型支持的應用程式的過程。LangChain 可以輕鬆地管理與語言模型的互動,將多個組件連接在一起,並集成額外的資源,例如 API 和資料庫。 LangChain https://python.langchain.com/en/latest/index.html 不說廢話,直接開始試著安裝, pip install langchain pip install openai export OPENAI_API_KEY="..." 以下是一些 LangChain 的簡單程式碼: import os os.environ["OPENAI_API_KEY"] = "..." from langchain.llms import OpenAI from langchain import OpenAI, ConversationChain from langchain.agents import initialize_agent from langchain.agents import load_tools from langchain.chains import LLMChain from langchain.prompts import PromptTemplate prompt = PromptTemplate( input_variables=["product"], template="What is a good name for a company that makes {product}?", ) print(prompt.format(product="colorful socks")) # What is a good name for a company that makes colorful socks? 在 LangChain 中,開發人員可以使用 LLM、Chat Model、Agents、Chains、Memory