Questions tagged [codeigniter-url]

By default, URLs in CodeIgniter are designed to be search-engine and human friendly. Rather than using the standard "query string" approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach: example.com/news/article/my_article

CodeIgniter URLs can be simplified a number of ways, either via helpers, or routing.

URL Helper

Makes your life easier by bringing functionality to your fingertips without typing out lengthy repetitious urls or anchor code. Things like:

  • site_url()
  • base_url()
  • current_url()
  • anchor() ouputs something like <a href="http://example.com">Click Here</a>
  • and more...

Routes

Typically there is a one-to-one relationship between a URL string and its corresponding controller class/method. The segments in a URI normally follow this pattern:

example.com/class/function/id/

However you may want something crazy like this:

example.com/page/when-i-use-php-i-sneeze/12/4/2011/bob

Routes help you achieve that and still point to the proper class/method in an example like so:

$route['product/:num'] = "catalog/product_lookup";

You can match literal values or you can use two wildcard types:

  • (:num) will match a segment containing only numbers.
  • (:any) will match a segment containing any character.
406 questions
-1
votes
2 answers

Codeigniter Controller class login form : 404 page not found

Im trying to combine several tutorials about Codeigniter and bootstrap and understand per codes so i can integrate it in my project. What i am trying to do right now is create a login form using the two framework. And i setup my View according to…
-1
votes
1 answer

How to handle https request if ssl is not installed on server using codeigniter

I just tried with http ans https to fetch data in the for of json from server, while I try with http its working fine but when I try with https getting error. Is there any way to handle "https" request if server is not cofigured with SSL.
-1
votes
2 answers

how to make url as pretty url in codeigniter

I am new to ci. naybody knows how to minify the url. for example : yourdmain.com/blog/view/blog-title I need this url to be like this : yourdmain.com/blog-title please explain how to do this this can be many like blog, categories, pages, posts…
-1
votes
1 answer

how insert page number to pdf while exporting data from php

I am exporting data table from php page to pdf I got the page exported to pdf but i can't insert the page number into the pdf file how to insert that function changeDetails() { $bType = $this->input->post('textvalue'); if($bType ==…
udaya
  • 9,598
  • 15
  • 48
  • 67
-1
votes
1 answer

Using htaccess to remove sub-directories from URL in CodeIgniter

My CodeIgniter project is placed inside sub-folders and I want to hide those two sub-folders with .htaccess. Everything is working fine but my current URL looks like this: example.com/folder1/folder2/ci_project/class/function/$id I want this to…
-1
votes
2 answers

Remove specific segment from a URL

I am using codeigniter 2.xx, and this is my view code: And this is my controller code: function user_info($name, $id) { $info['info'] = …
Azam Alvi
  • 6,918
  • 8
  • 62
  • 89
-1
votes
1 answer

Ajax open in new tab

I have ajax website and when i click a link to open in new tab it takes me to home is there any library or helper for ajax where open in new tab work ?
Sundas Subhani
  • 23
  • 2
  • 10
-1
votes
3 answers

How do I send email to local system using xamp and windows7 in codeigniter?

I'm trying to run this code : $this->load->library('email'); $this->email->from('anu1488@gmail.com', 'Anudeep'); $this->email->to('anu1488@gmail.com'); $this->email->subject('Email Test'); $this->email->message('Testing the…
Anudeep GI
  • 931
  • 3
  • 14
  • 45
-1
votes
3 answers

How to make urls like category/5/sub_category in CodeIgniter

I want my urls to look like: www.domain.com/catalog/category_name/category_id/product_name/product_id. How should my controllers look like to accomplish this? It's ok for the Controller to have Catalog and Function category_name in it. But what will…
-2
votes
1 answer

Related SEO and PHP Framework

I am making a movie database and discussion forum just for my state. I likes to do more SEO work and expecting more traffic. I likes to do the work in Codeigniter framework . My doubt is how codeigniter will help in SEO process or there is any…
ramesh
  • 4,008
  • 13
  • 72
  • 117
-2
votes
1 answer

When CodeIgniter controller starts with capital letter, it gives 404 Not Found

When I write mysite.com/Site/Home in the browser, it gives me: 404 Page Not Found!, while when change the controller name to small letter (mysite.com/site/Home) it runs well !! How to overcome such issue ?!
-2
votes
1 answer

Codeigniter - Url Routing

i will make a project management web app. if the user register the system will give a URL. www.site.com/company_name how should i do it when he user used this url it will also check in the database if it exist? in codeigniter the format should be …
-2
votes
2 answers

How can I pass a direct link to download some file from the browser in a Code Igniter based website? Like this: www.example.com/examplemovie.mov

I need to allow a link like this www.example.com/example.mov to be accessed or downloaded via browser in a code igniter application. Right now i received a "Page not found" message. The file is in the root directory, but i think there is some config…
MCP
  • 51
  • 1
  • 2
  • 5
-3
votes
1 answer

Codeigniter put protocol in url query

Possible Duplicate: How do you pass a URL into a CodeIgniter controller? How to make this works http://example.com/route/http://redirecturl.com in codeigniter I want create route that handling url, like http://who.is/whois/http://google.com
oknoorap
  • 1,923
  • 2
  • 14
  • 20
-3
votes
2 answers

Get the value of query string

http://www.example.com/ci_admin_jaspud/index.php/admin/add_member/id/7/created_sort/asc how can i get the value of multiple query strings in above url using codeigniter?
1 2 3
27
28