CodeIgniter Forums
How to create long tail url in CI 3. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: How to create long tail url in CI 3. (/showthread.php?tid=77404)



How to create long tail url in CI 3. - shekhu - 08-27-2020

Hey,
     I am newbie in CI 3 I choose my new project ifsc finder tool to make on ci 3. But I am facing some URL kind of issue. I know that ci URL work on this hierarchy Controller > Method > params. But I want to SEO URL like domain_name/query1/query2/query3 and so on.
My site URL https://www. ifsccode-bank.in and I want to achieve like this URL https://www. ifsccode-bank.in/state-bank-of-india/west-bengal/ballygunge/comm-br-ballygunge
How to create like this URL.


RE: How to create long tail url in CI 3. - Ashok@in - 08-31-2020

This is simply.
controller/function/var/var/var

Example:
in controller index function call var / var / var

index($var1,$var2=null,$var3=null,$var4=null){
// your code
// $var1 is bank name
// $var2 is city name
// $var3 is another name
// $var4 is another name

}

this url like this
/$var1/$var2/$var3/$var4