@maci
To remove the file name from a URL using .htaccess, you can use the following code:
1 2 3 4 |
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^([^.]+)$ $1.php [NC,L] |
This code assumes that you have Apache mod_rewrite enabled on your server.
Explanation:
For example, if you have a file named "example.php" and you want to access it without the ".php" extension, you can use the URL "http://example.com/example". The .htaccess code will internally map this URL to "example.php" without revealing the file name in the URL.