codeigniter-url

Route to redirect to a controller + an action by default on CodeIgniter?

南楼画角 提交于 2020-01-13 05:39:07
问题 I'm currently working on a project with Codeigniter. I have one controller called Cat class Cat extends CI_Controller { function __construct(){ parent::__construct(); } function index($action){ // code here } } and a route (in routes.php) $route['cats/:any'] = 'cat/index/$1'; And that works if I use this URL for example: http://www.mywebsite.com/cats/display Nevertheless, if the user changes the URL to http://www.mywebsite.com/cats/ it doesn't work anymore. Codeigniter writes: 404 Page Not

How would i create a vanity url in codeigniter

和自甴很熟 提交于 2020-01-12 10:30:47
问题 How can i create a vanity url in codeigniter. Im having real trouble doing this in the framework. And there doesnt seem to be any good answers out there. 回答1: It's possible, I'm using this in one of my projects... Here is a thread on the CodeIgniter forums showing how to do it... http://codeigniter.com/forums/viewthread/113962/ 回答2: According to Personalized User Vanity URL's in CodeIgniter, you can accomplish this by modifying your routes file: $handle = opendir(APPPATH."/modules"); while

Code Igniter - URL Rewrite

試著忘記壹切 提交于 2020-01-07 09:28:21
问题 Hey, i'm trying to get a project to work, but i am having trouble with the rewrite module. I'm running Wamp over Windows XP. I changed httpd.conf to change the root of localhost to: DocumentRoot "C:/wamp/www/project/docroot/" I have htaccess RewriteEngine On RewriteBase / my Apache has the rewrite module Activated. my base_url() in config.php is 'http://localhost/' in routes.php i have: $route['default_controller'] = "home"; $route['our-recipes'] = "recipes"; and more pairs when i point the

CodeIgniter returns 404 for all routes but works

别说谁变了你拦得住时间么 提交于 2020-01-05 10:10:04
问题 I have strange problem with CodeIgniter and routing system and can't find solution for it, so: I have several routes such as 'forum/(:num)' => 'forum/category/$1', 'forum/(:num)/(page:any)' => 'forum/category/$1/$2', and them works, but return 404 code in header. I mean I don't get 404 page, correct HTML returns and page's content displays correctly for my forum's categories. But I'm getting 404 in header (Network tab in Firebug), so I can't work with POST data correctly. If I request /forum/

Passing multiple optional parameter/value pairs with user defined pair order

こ雲淡風輕ζ 提交于 2020-01-01 19:54:13
问题 Say user is going to search on 4 or 5 fields, ok? eg. he might want to search by firstname, email, mobile or even page number I want that codeigniter's url be like this: site.com/Controller/Method/variable1/value1/variable2/value2/variable3/value3 or site.com/Controller/Method/variable2/value2/variable3/value3/variable1/value1 (that they should have the same result) or in this format site.com/Controller/Method/variable2/value2/variable4/value4 some examples to clarify my question: site.com

Use of undefined constant CURLOPT_IPRESOLVE - assumed 'CURLOPT_IPRESOLVE'

半世苍凉 提交于 2019-12-31 05:35:12
问题 i have http://www.idiotminds.com/login-with-facebook-in-codeigniter/ but i have error > A PHP Error was encountered > > Severity: Notice > > Message: Use of undefined constant CURLOPT_IPRESOLVE - assumed > 'CURLOPT_IPRESOLVE' > > Filename: facebook/base_facebook.php and i fix CURLOPT_SSL_VERIFYPEER => false, but not fixed but i have enable the php_curl ** cURL support enabled cURL Information libcurl/7.24.0 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 ** code public static $CURL_OPTS = array(

Redirect error in codeIgniter

不羁的心 提交于 2019-12-26 00:15:23
问题 I am trying to the code function validate(){ $this->load->library('session'); $this->load->model('inventory/inventoryModel'); $result = $this->inventoryModel->validateUser(); if($result == 1){ $data = array( 'username' => $this->input->post('username'), 'is_loged_in' => TRUE ); $this->session->set_userdata($data); } else{ $this->index(); redirect('inventory/validate'); } } and getting the error in chrome "This web page has a redirect loop" what is solution? 回答1: You have $this->index() which

CodeIgniter's default controller doesn't load

萝らか妹 提交于 2019-12-25 14:29:13
问题 I have inherited an on-going CI v2.0.2 project. I tried loading the default controller - http://localhost/ci202/index.php - but all I got was a blank page. I enabled logging for all messages, and here's the log: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?> DEBUG - 2012-10-05 23:55:41 --> Config Class Initialized DEBUG - 2012-10-05 23:55:41 --> Hooks Class Initialized DEBUG - 2012-10-05 23:55:41 --> Utf8 Class Initialized DEBUG - 2012-10-05 23:55:41 --> UTF-8

Codeigniter cannot refresh page after session destroy and direct

≡放荡痞女 提交于 2019-12-24 15:11:40
问题 I have a PHP program written on code igniter that needs your help! Have been trying for 3 weeks! I have the htaccess mod rewrite to make http://www.sampleurl.com/controllername instead of http://www.sampleurl.com/index.php/controllername <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] </IfModule> <IfModule !mod_rewrite.c> # If we don't have mod_rewrite installed, all 404's # can be sent to

permitted_uri_chars in codeigniter

醉酒当歌 提交于 2019-12-24 01:56:16
问题 I am getting en error of "The URI you submitted has disallowed characters" when returning from facebook (using facebook login). i have set permitted_uri_chars as follows: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?='; and my url is: http://www.example/login?state=460f0c9e013ecc3fcbeeas9592ba2cf2e&code=AQDWuAZtPI3UK6vZVL8NL5h0LE28z1jdMRtAbFVjB0IUM7P5WsGFijwlgmzGGZWM37TG0tnCeD8YD-bqCKxilATkyJpiE6UdXhdN0s_s