2010年11月18日 星期四

[教學] 快快樂樂刪除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'] = "";

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

參考資料
官方網站說明

24 則留言:

匿名 提到...

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

匿名 提到...

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

匿名 提到...

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/

匿名 提到...

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

匿名 提到...

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

匿名 提到...

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

匿名 提到...

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

匿名 提到...

Ι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

匿名 提到...

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

匿名 提到...

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

匿名 提到...

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

匿名 提到...

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

匿名 提到...

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

匿名 提到...

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

匿名 提到...

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.

匿名 提到...

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

匿名 提到...

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

匿名 提到...

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

匿名 提到...

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

匿名 提到...

*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

匿名 提到...

bookmarked!!, I love your site!

Visit my web page - can you drink coffee when taking green coffee bean extract

匿名 提到...

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

匿名 提到...

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 ()

匿名 提到...

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

張貼留言

Facebook