I have the following `.htaccess` file which helps me to rewrite the `http://domain/path/project.php?id=1` as `http://domain/path/project/1`.

```
RewriteBase /
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ project.php?id=$1 [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ project.php [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^(.*)$ project.php [QSA,NC,L]   

```

But I need all the php's in the current directory to be replaced in the same way. I have `edit_project.php?id=1`, `delete_project.php?id=1` etc. `id` is a default parameter for all the php's except some. So I want the htaccess to do the following.

`http://domain/path/*.php?id=1` as `http://domain/path/*/id`
and when there is no id, it should just look like `http://domain/path/*` and when there are other parameters, it should look like `http://domain/path/*?param=value`

Since I am new to .htaccess, any help would be appreciated. Also please explain me how this works.