56 responses to “CodeIgniter htaccess”

  1. igi shellshock

    i follow this tutor, my default controller is ‘dashboard’, it works.people can check here http://jobcareer.polibatam.ac.id but when i tried do like http://jobcareer.polibatam.ac.id/login didn’t work.please help me..thx..

  2. igi shellshock

    thx dimas for reply, this my .htaccess file

    RewriteRule ^(dashboard(/index)?|index(\.php)?)/?$ / [L,R=301]
    RewriteRule ^(.*)/index/?$ $1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} !^(www|jobcareer) [NC]
    RewriteRule ^(.*)$ http://www.polibatam.ac.id/$1 [R=301,L]
    

    config.php file

    $config['base_url']	= 'http://jobcareer.polibatam.ac.id/';
    $config['index_page'] = '';
    
    		$session->userdata('sesblabla')=="")
    		{
    			redirect('/login/');
    		}else{
    			$data['base'] = $this->config->item('base_url');
    			$this->load->view('dashboard',$data);
    		}
    	}
    
    	function logout()
    	{
    		$this->session->sess_destroy();
    		redirect('/login/');
    	}
    }
    

    why still access index.php/dashboard/ ? not /dashboard/

  3. T. Brian Jones

    This is a great post. Thanks for taking care of all these details. These are often overlooked and can make a HUGE difference for SEO. I’ve seen sites of mine double their number of indexed pages, almost overnight, after making these improvements. It’s nice to have them done on my new project right from the start.

  4. Johan van de Merwe

    This only works if you have in your config.php file:
    $config['uri_protocol'] = ‘AUTO’;
    Which I hadn’t in first instance (QUERY_STRING).
    Now it works fine.

  5. Harry

    All forms on my site now fail to post with the addition of the htaccess code. Could it be something to do with WAMPserver? I have followed the instructions exactly.

  6. sh

    good art
    @Johan van de Merwe +1
    I had problems with my ajax get requests, had to change them to post and now works fine

Leave a Reply