0

I build codeigniter project and i have tested it in my local machine using http://localhost/wg/ as base url. I upload that project to server and my new url like http://project.microsols.com/wardrobe/ Home page is working. But when i click on any other link it will give error. It is giving

Not Found
The requested URL /index.php/person was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

But it will work fine when i put index.php before my controller it will work fine.. And this is my .htaccess file:

RewriteEngine on
RewriteBase /wardrobe/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L,QSA]

What is the issue behind this error??

Alex Tartan
  • 6,736
  • 10
  • 34
  • 45
Zain
  • 1
  • 4

2 Answers2

0

Paste this code in your .htaccess file and then try:

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

It will work fine.

Akshit Ahuja
  • 337
  • 2
  • 15
0

By default codeigniter urls include the index.php in the url. You need to remove index.php from the url to make it work. Please follow the answer here to do the same.

Sinha
  • 512
  • 4
  • 11