How to remove .php, .html, .htm extensions with .htaccess

How to remove .php, .html, .htm extensions with .htaccess

What is an .htaccess file
An .htaccess file may be a simple ASCII file that you simply create with a text editor like Notepad or TextEdit. The file lets the server know what configuration changes to form on a per-directory basis.

Please note that .htaccess is that the full name of the file. It isn’t file.htaccess, it’s simply .htaccess.

.htaccess files affect the directory during which they’re placed in and every one children (sub-directories). for instance if there’s one .htaccess file located in your root directory of, it might affect,, then on…

It is important to recollect that this will be bypassed. If you don’t want certain .htaccess commands to affect a selected directory, place a replacement .htaccess file within the directory you don’t want to be affected with the changes, and take away the precise command(s) from the new file.

With an .htaccess file you can:

Redirect the user to different page
Password protect a selected directory
Block users by IP
Preventing hot-linking of your images
Rewrite URLs
Specify your own Error Documents
In this tutorial we’ll be focusing only on rewriting URLs.

Removing Extensions
To remove the .php extension from a PHP file for instance to you’ve got to feature the subsequent code inside the .htaccess file:

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

If you would like to get rid of the .html extension from an HTML file for instance to you merely need to change the last line from the code above, to match the filename:

RewriteRule ^([^\.]+)$ $1.html [NC,L]

That’s it! you’ll now link pages inside the HTML document without having to feature the extension of the page. For example:

Adding a trailing slash at the top
I received many requests asking the way to add a trailing slash at the top, for example,

Ignore the primary snippet and insert the code below. the primary four lines affect the removal of the extension and therefore the following, with the addition of the trailing slash and redirecting.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]

Link to the HTML or PHP file an equivalent way as shown above. Don’t forget to vary the code if you would like it applied to an HTML file rather than PHP.

For Example

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^location/([0-9a-zA-Z_]+) job-by-city.php?city=$1
RewriteRule ^category/([0-9a-zA-Z_]+) job-by-category.php?category=$1

RewriteRule ^openings/([0-9a-zA-Z_]+)/([0-9a-zA-Z_]+) jobs-link.php?city=$1&category=$2

RewriteRule ^details/([0-9]+) job-details.php?jdid=$1

ErrorDocument 404 /404.php

RewriteRule ^jobs-in-delhi?$ jobs-in-delhi.php

Some people asked how you’ll remove the extension from both HTML and PHP files. I don’t have an answer for that. But, you’ll just change the extension of your HTML file from .html or .htm to .php and add the code for removing the .php extension.

How to Increase the Maximum File Upload Size in WordPress

How to Check Your Maximum File Upload Size Limit in WordPress?

WordPress will automatically show the utmost file upload size limit once you are uploading images or media. to see it you’ll simply attend Media » Add New page and you’ll see the utmost file uplaod size limit for your WordPress site.

1: Theme Functions File

There are cases where we have seen that just by adding the following code in theme’s functions.php file, you can increase the upload size:

@ini_set( 'upload_max_size' , '32M' );
@ini_set( 'post_max_size', '32M');
@ini_set( 'max_execution_time', '300' );

htaccess Method

Some people have tried using the .htaccess method where by modifying the .htaccess file in the root directory, you can increase the maximum upload size in WordPress. Edit the .htaccess file in your WordPress site’s root folder and add the following code:

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
How do I change website from http to www

How do I change website from http to www

You can follow these 2 Methods for redirect wordpress website from http to www

Method: 1 For Any Website

Step: 1 Go to Cpanel and Click on setting

Step: 2 Now enable Checkbox of hidden files

Step: 3 Refresh your Cpanel and go inside public_html here you see .htcess files you jst replace all available code to below code


                              RewriteEngine On

                             RewriteCond %{HTTP_HOST} !^www\. [NC]

                             RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


Step: 4   If you don’t have .htaccess files then create a file name with  .htaccess 

          and paste above code and save them


Step: 3 Now Refresh Your Website.

                  That’ It.


Method: 2 For Any WordPress Website

Step: 1  Go to Settting

Step: 2  General Setting Here You see

               WordPress Address (URL) and Site Address (URL) change http:// to http://www and update                       them

Step: 3 Now Refresh Your Website.

                  That’ It.

Basant Mallick

How to integrate live chat in website

How to integrate live chat in website

*** How to integrate live chat in website ***

Just follow below instruction to integrate Live Chat on your Website.

Steps:1 Visit This link



Steps:2 SignUp Your Account


Steps:3 Now You see three Input type
a: Name
b: Email
C: Password
then sign up now


Steps:4 Choose Which Language you want to chat to User.


Steps:5 Enter Site Name and Site Url (like click next


Steps:6 Here you can Skip if you don’t Want to add your agent
just click on Install Widget.


Steps:7 Now Here you see some script code copy all the code and paste them in between <head></head>


Steps:8 You Can access Chat panel on your smartphone and many more devices just download their application from their play store and logged in.
Steps:9  That’s it.
Now refresh Your Website You can see the chat logo and panel
on right below side.

Basant Mallick