CodeIgniter vs. Friendly URLs
Moderator: General Moderators
CodeIgniter vs. Friendly URLs
I'm getting ready to start development on a site for local businesses. Clearly, I want the clients to have a "user-friendly" URL such as "mystate.example.com/mybusiness". However, I'm leaning toward using the MVC design w/ CodeIgniter for the design. I cannot for the life of me see a way to use the framework AND have a user-friendly URL w/out going to the pains of setting up redirects to have "mystate.example.com/mybusiness" point to "www.example.com/class/function/ID" for every site I create. Anyone figured out a way around this or have any ideas? This has been one of my biggest gripes w/ using frameworks rather than banging it out from scratch.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: CodeIgniter vs. Friendly URLs
Well CI likely has an option switch somewhere in it's config files that when enabled will generate links which are SEO friendly.
That is, instead of:
It would generate links like:
You would then enabled the .htaccess file and that is about all that would need to be done. In your own scripts ot templates you would either need to:
1. Generate SEO friendly links
2. Check the API and see if there is an _isSeoRequired() and generate SEO friendly links or dynamic links depending on the setting.
The latter I have no idea if it's possible but it would make sense to me with the limited knowledge I have of CodeIgnitor...
Cheers
That is, instead of:
Code: Select all
index.php?page=about-usCode: Select all
about-us.php1. Generate SEO friendly links
2. Check the API and see if there is an _isSeoRequired() and generate SEO friendly links or dynamic links depending on the setting.
The latter I have no idea if it's possible but it would make sense to me with the limited knowledge I have of CodeIgnitor...
Cheers
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: CodeIgniter vs. Friendly URLs
Perhaps you should have a little humbler signature -- unless you actually know everything. 
http://codeigniter.com/user_guide/general/routing.html
http://codeigniter.com/user_guide/general/routing.html
(#10850)
Re: CodeIgniter vs. Friendly URLs
Thanks Hockey.
It was supposed to be a little cheesy PHP humor, but I guess of the Gods of PHP disapprove. I didn't know you had to know everything to not be considered an idiot. Anyway, thanks for the link. Looks like what I need...Perhaps you should have a little humbler signature -- unless you actually know everything.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: CodeIgniter vs. Friendly URLs
I found it cheesy if that helps any?It was supposed to be a little cheesy PHP humor, but I guess of the Gods of PHP disapprove
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: CodeIgniter vs. Friendly URLs
No ... but the spirit of these forums is that we are all ignorant and even foolish in some areas ... which is why we ask questions and share answers ...Arocity wrote:I didn't know you had to know everything to not be considered an idiot.
Perhaps:
Code: Select all
while($people->haveQuestions()){
$me->answer($person->question());
++$karma;
}(#10850)