在地址中更改“index.php”

I am developing a website in which i want to change my page home.php into page home

I tried this .htaccess code

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php page=/$1 [L,QSA]

Please help me.

Just this:

RewriteEngine On
RewriteRule ^(.*)$ $1.php [L,QSA]
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
# Replace html with your file extension, eg: php, htm, asp

This will work on local, but when you release your project don't forget to check if rewrite is enabled for the current server.

Try this:

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