1

I am working in php project using codeigniter. I am very new to codeigniter. I have exiting project that i managed to run properly.But when i am inserting username and password,its giving me error as=

 "The requested URL /PRS/index.php/login was not found on this server."

I am using wamp server. httpd.conf file has documentRoot as "c:/wamp/www/PRS/" My .htaccess file has code as-

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

My project's config.php file has code as-

$BASE_URL = "http://".$_SERVER['SERVER_NAME']."/PRS/"  ; 
$DB_HOST = "localhost";
$DB_USER = "root";
$DB_PASSWORD = "mysql";
$DB_NAME = "prsdb";

So can someone please help me..

tshepang
  • 12,111
  • 21
  • 91
  • 136
user1722857
  • 877
  • 2
  • 19
  • 33
  • Could you add info on what URL you're accessing to get that error, and where under the server root your application is placed? `/PRS` does not seem to be obviously connected to `/wishlist` in any way. – Joachim Isaksson Aug 16 '13 at 10:19
  • Ya i edited my code as above..i am using url as-http://www.prs.net/PRS/index.php/login..My application is placed in wamp/www/PRS – user1722857 Aug 16 '13 at 10:21
  • Looks like you've set it up to rewrite without the index.php and the PRS directory. Try taking those two out of your URL. So wamp/www/login – Rick Calder Aug 16 '13 at 10:27

1 Answers1

0

At first make sure mod_rewrite is enabled in httpd.conf file and after that, overwrite your .htaccess file which is located your project root folder with the following code..

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

And then set your base url like following..

$BASE_URL = "http://".$_SERVER['SERVER_NAME']."/PRS/";

And change your config file like following..

$config['index_page'] = '';

And finally use the following url to access..

prs.net/PRS/login

Or, you can check the following url to get some help..

Cannot remove index.php from CodeIgniter URL

Community
  • 1
  • 1
Hasib Tarafder
  • 5,773
  • 3
  • 30
  • 44