1

I want to remove index.php from url while accessing controller.
This is the current working url : http://localhost/jplugins/index.php/home/index/
But it gives error(404 Page Not Found) when i access using url : http://localhost/jplugins/home/index/

Here are the things i tried while searching over stackoverflow :
1. set $config['index_page'] = ""; in config/config.php
2. place .htaccess , I have tried every htaccess file i found in threads.. none work
3. enable rewrite module in xampp
4. set $config['base_url'] = 'http://localhost/jplugins/'; didnt work either
5. Reinstall Xampp. No change
6. change $config['uri_protocol'] = 'AUTO'; . I have tried every method listed in comment but it only gives home/index output no matter what the query is, like http://localhost/jplugins/asdwhadsadasdasdasdadas/asdasda//asdad --> will give same output as http://localhost/jplugins/index.php/home/index/.
Lastly i sent my whole code to someone who was also using xampp. It worked there perfectly. Using same xampp version 3.2.1( May 7th 2013).
I'm using windows 7 32bit.
What could be the problem here?

Sojan Jose
  • 3,054
  • 6
  • 30
  • 45
  • Have you setup the proper allow / deny directives to use .htaccess on your apache virtual host? – JohnP Jan 03 '15 at 15:11
  • do you need to set that? the other person tried my code on stock xampp settings. – Hassan Nawaz Jan 03 '15 at 15:13
  • Depends, maybe try comparing the vhost files for both configurations to see if there are any differences so you can eliminate that as the culprit. – JohnP Jan 03 '15 at 15:18
  • Does the solution in this question work for you? - http://stackoverflow.com/questions/15350137/codeigniter-htaccess-removing-index-php-from-url?rq=1 – JohnP Jan 03 '15 at 15:19
  • after adding line RewriteBase /jsplugins . output is still the same. redirected to xampp page with the htaccess from the answer below – Hassan Nawaz Jan 03 '15 at 15:25
  • It seems you have another .htaccess file (parent) which redirects you `localhost/xampp/splash.php` when a file not found. – Shaiful Islam Jan 03 '15 at 17:01

1 Answers1

1

Create a .htaccess file in your jplugins directory and add the following code:

RewriteEngine On

RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]