0

I have a web site and I have installed CodeIgniter 2 Site under sub folder (test)

Users can access the site by using following link:

http://www.example.com/test/

When user is going to access (test) site using above link URL redirected to following link and following error will displayed.

http://www.example.com/test/login

Not Found

The requested URL /test/login was not found on this server.

Then I add index.php to the above URL, login page displayed.

http://www.example.com/test/index.php/login

When I submit my username and password again URL redirected to, without logged on.

http://www.example.com/test/login

And again, not found.

.htaccess:

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> 

config.php:

$config['base_url'] = ''; $config['index_page'] = ''; $config['uri_protocol'] = "AUTO" ; 

I have tried $config['base_url'] = "http://www.example.com/test" - still not working.

6
  • did you load url helper ? in autoload.php $autoload['helper'] = array('url'); Commented Jul 2, 2015 at 6:15
  • remove space between / / $config['base_url'] = 'http://www.example.com/test' Commented Jul 2, 2015 at 6:17
  • Check all controllers and models file names and class names have first letter upper case Commented Jul 2, 2015 at 6:19
  • this site working in localhost but online not working Commented Jul 2, 2015 at 6:22
  • test this $config['uri_protocol'] = 'PATH_INFO'; Or $config['uri_protocol'] = 'REQUEST_URI'; Commented Jul 2, 2015 at 6:24

3 Answers 3

1

in config/config.php

$config['base_url'] = 'https://stackoverflow.com/'; $config['index_page'] = ''; 

in .htaccess (place outside application folder)

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> 
Sign up to request clarification or add additional context in comments.

22 Comments

nothing happen... .. my code worked properly on my localhost. but not in web server.
live url to check this out??
live url ; noritake.lk/themes please check, with index.php noritake.lk/themes/index.php/login , cant login , redirected to noritake.lk/themes/login
did you place htaccess out side of folder??
htaccess in noritake.lk/themes folder
|
0

replace .htaccess with this code

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] 

Comments

0

try this in your .htaccess

RewriteEngine On RewriteCond %{REQUEST_URI} ^/system.* RewriteRule ^(.*)$ index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ index.php?/$1 [L] 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.