删除index.php WAMP

I have a site and it works to type "www.mysite.com/folder/" (if i have a index file in that folder).

It also works to type "www.mysite.com/folder/index.php"

All fine and good, but I want it so if you type /index.php it will remove the index.php on the end also if I use a form and post to index.php I don't want that to show in the url.

I have looked around and seen every solution say .htaccess rewrite, but It don't seem to be working / or its just not the same thing that I want?

or do I need to use javascript and update the address bar?

(I'm using WAMP)

EDIT:

Things I've have tried:

1

httpd.conf

AllowOverride All

2

I have enabled: Apache modules> rewrite_module

3

I have created a .htaccess placed in my wamp/www folder

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

4

wamp/apps/phpmyadmin/config.inc.php added

$cfg['index_page'] = '';

EDIT 2: This look like it works, but it messes up my POST to index.php so it breaks my login (It don't start the session).

RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?)
RewriteRule ^ /%1 [R=301,L]

An .htaccess file is definitely the correct solution. If it isn't working, try one of these possible answer:

.htaccess not working on localhost with XAMPP

How to use .htaccess in WAMP Server?

.htaccess not working on WAMP


Update: Re-reading your question, you might be using an older htaccess script (for PHP < 5.2.6 version). I'm not sure if the script will work in current versions. Try:

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

The ? after index.php in final line is the difference

If above doesn't help, what version of PHP does the PHP command phpinfo() report?

<?php
    phpinfo();
    die();