ALL SYSTEMS OPERATIONALUPTIME 99.97%FLEET 18/18IN-MUM · US-LAX · EU-FSN EST. 2003 · +91 11 4998 4038

KNOWLEDGEBASE · .HTACCESS

How do I remove file extensions?

Last updated 2019-02-03


If you would like to remove the ending extensions for your files such as; .html, .php, .htm, and so forth, this can be done quite simply using the following steps:



Developer Note: this is a feature that you will be using .htaccess files to turn on the mod_rewrite engine feature within your hosting.

1. Open Notepad (or text editor)

2. Add the following code:

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

3. $1.php Replace with your preferred extension (You might need to replace this value with whatever extension you are looking to get rid of e.g. $1.html)

4. Save as .htaccess

5. Upload to your server's public_html folder



Developers Note:
* Please note that this function is provided by us. However, is officially unsupported, and testing of this is at your own risk.
* Should you have any questions, please let our support department know.
* We HIGHLY advise that you do backups of your .htaccess file before uploading the updated one.

← All knowledgebase articles

Tell us what has to stay up.

A short conversation with an engineer. No quote-bot, no callback queue. We'll tell you honestly if we're not the right fit.