CodeIgniter Forums
Doubt on url Formation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Doubt on url Formation (/showthread.php?tid=34834)



Doubt on url Formation - El Forum - 10-11-2010

[eluser]oldrock[/eluser]
Hi ..,

I need to get the url of my site as www.mysite.com/web-page/webpage

my doubt is hoe to obtain an url with hyphen since the function names and class names does not permit hyphen in them.., so i can not name my controllers class and functions with hyphen's.

so just guide me to obtain the url in the above format it would be very grateful for me.

thanks in advance


Doubt on url Formation - El Forum - 10-11-2010

[eluser]Jônatan fróes[/eluser]
You can config it in your route
Code:
$route["web-page/(:any)"] = "web_page/$1"



Doubt on url Formation - El Forum - 10-11-2010

[eluser]oldrock[/eluser]
Hi..,

Thanks For Your Reply , but i still get 404 page not found

The original URL that looks in the address bar should be like this http://cricruns.com/world-cup-2011/teams

which should point to the controller named world_cup_2011in my controller folder.

I have configured my routes file as directed by you as follows

$route['world-cup-2011/(:any)'] = "world_cup_2011/$1";

Whether my setting is right or i am going wrong some where...?

Thanks in advance


Doubt on url Formation - El Forum - 10-11-2010

[eluser]Jônatan fróes[/eluser]
Code:
$route['world-cup-2011'] = "world_cup_2011"; //index page
$route['world-cup-2011/(:any)'] = "world_cup_2011/$1"; //others pages



Doubt on url Formation - El Forum - 10-11-2010

[eluser]oldrock[/eluser]
That has done the trick..

Thanks a lot