htaccess文件来制作干净的网址

I am using wamp server which consists of my project folder testCase which consists of few php files

testCase
  - view.php
  - add.php
  - delete.php
  - .htaccess

In the .htaccess file I have code like

RewriteEngine on
RewriteRule ^view?$ view.php

I am trying to run my project with url as "localhost/testCase/view" rather than "localhost/testCase/view.php" which results as Not found

I have found many tutorials regarding this htaccess in stackoverflow. Since I am a very beginner to programming, I could not fix this issue. Can anybody please help me. Even I get down vote or duplicate question I am eager to fix my issue.

Thank you.

You want to remove .php extension,

Try below rule,

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.+?)$ $1.php [QSA,NC,L]

Above will work for all your php files in testcase directory.