CodeIgniter Forums
Need Help with Redirection - 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: Need Help with Redirection (/showthread.php?tid=37919)



Need Help with Redirection - El Forum - 01-24-2011

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


I need some help with redirection,


the url should be shown in the address bar as below

http://cricruns.com/venue/india/M.A.-Chidambaram

this url must be redirected as the below

http://cricruns.com/index.php/venue/stadium?name=M.A.-Chidambaram&tournament=World-Cup-2011

thanks in advance


Need Help with Redirection - El Forum - 01-25-2011

[eluser]Narkboy[/eluser]
[quote author="oldrock" date="1295953833"]Hi..,


I need some help with redirection,


the url should be shown in the address bar as below

http://cricruns.com/venue/india/M.A.-Chidambaram

this url must be redirected as the below

http://cricruns.com/index.php/venue/stadium?name=M.A.-Chidambaram&tournament=World-Cup-2011

thanks in advance[/quote]

Hi - not sure you want redirection as much as routing.

Redirection takes a user to a different URL - routing loads code based on the current URL.

Are you using query strings in your CI config? If not, then the second URL is invalid and you can't load it.

You also have an issue with the params you want the URL to convey. In the first, the address shows 'venue', 'india' and 'M.A.-Chidambaram'. The second does not contain 'india' but does contain 'World-Cup-2011'.

Unless ALL 'india' pages relate to 'World-Cup-2011' then you need to tell CI to look for that specifically.

/B