Removing file extensions from URLs will not have any impact on your SEO, it will make your website URL look cleaner, can make your website file structure appear more complex and could help some day if you are planning to switch from static files to a blog or content management system that allows customized permalinks, like WordPress.You can do this in two ways: per file or all files.
Simply add the code snippet to your .htaccess file.
In both methods, the code syntax is, where is the start and is the end result:
RewriteRule ^<to>$ <from> [L]
The following code snippet demonstrates a single file.
RewriteRule ^about$ about.php [L]
The above is per file, therefore any static file will require the same line of code. Each one should be on its own line.
Now the following will change all static files:
RewriteRule ^([^/.]+)/?$ $1.php [L]
If you want the new, clean URL to start with a directory, just add the directory name right after the ^ and followed by a backlash. It’ll look something like this:
RewriteRule ^page/([^/.]+)/?$ $1.php [L]
The above example uses a directory called page. The directory does not really exist and you should not create it. It will just appear to exist.
For each method, whether a single file or all files, do not require the static file(s) to be PHP; they can be any file extension like HTML.
You can also use multiple and different RewriteRules, such as a single static file and a complex example. Just make sure the output are not the same or overlap.
You should also also place the code in the proper syntax, which is:
<IfModule mod_rewrite.c> RewriteEngine on </IfModule>
So in the end, your complete code would look something like this:
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^about$ about.php [L] </IfModule>