• Home
  • About Us
  • Archives
  • Contact Us
  • Privacy Policy
  • Copyright Policy

Free Tech Tutors

Useful Tips, Tricks And Tutorials

  • Android
  • Windows
  • Software
  • Software Testing
  • Web Application
  • Web Development
    • Blogger
    • WordPress
You are here: Home / Web Development / How To Redirect .html URL to .php Using .htaccess

How To Redirect .html URL to .php Using .htaccess

December 8, 2016 by Sathishkumar Varatharajan Leave a Comment

Are you planning to redesign your HTML website in .php script? If yes is your answer then file extension of your website would be changing to .php from .html once you finish the redesigning process. When you upload this .php version in the server without properly redirecting all .html URLs, your website will show 404 errors for all existing URLs that got indexed.

If you have no idea about how to do .html to .php redirection, don’t panic. Here I have given a simple tutorial to redirect .html URLs in your website to .php file extension using .htaccess.

Steps To Redirect all .html URLs to .php Using .htaccess

Step 1: To get started, log into your website cPanel.

Step 2: Now open up File Manager as shown in the screenshot below.

Step 3: Once you have opened the “File Manager“, right-click on “.htaccess” file and choose “Edit“.

Note: If you can’t find “.htaccess” file in your server, then you haven’t enabled “Show Hidden Files” option. Enable it by clicking on “Settings” in File Manager and then by ticking the “Show Hidden Files” box.

Step 4: Now add the code given below to .htaccess file and click on “Save“.

RedirectMatch 301 (.*)\.html$ $1.php

That’s it. Now you have successfully redirected all .html URLs to .php file extension.

If you would like to redirect only a specific URL like index.html to index.php, then you will have to add the following code in .htaccess:

RewriteRule ^index\.htm$ index.php [NC,R]

If you encounter any issues while following this tutorial, do let me know via comments.

Related Posts:

  • How To 301 Redirect www to non www URLs Using HTACCESSHow To 301 Redirect www to non www URLs Using HTACCESS
  • Create .htaccess File and Upload to ServerCreate .htaccess File and Upload to Server
  • How to Create Sitemap Manually?How to Create Sitemap Manually?
  • How To Create cPanel Account In WHM (VPS)How To Create cPanel Account In WHM (VPS)
  • How To Fix HTTP Error While Uploading Images In WordPressHow To Fix HTTP Error While Uploading Images In WordPress
Our Reader Score
[Total: 0 Average: 0]
Share2
Tweet
+11
Shares 3

Filed Under: Web Development

About Sathishkumar Varatharajan

Sathishkumar Varatharajan is a blogger, internet marketer, business consultant and the owner of Free Tech Tutors. You can connect with him at @sathishkumaratr!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe

Subscribe with us to get useful software tutorials and web application tips getting delivered directly to your email inbox!

Connect With Us

Visit Us On FacebookVisit Us On TwitterVisit Us On GooglePlusVisit Us On PinterestVisit Us On YoutubeVisit Us On LinkedinCheck Our Feed

Recent Tutorials

  • How To Turn Off Windows 10 Lock Screen Ads?
  • How To Bring Back The Quick Launch Bar In Windows?
  • How To Add An Application To The Quick Launch Menu In Windows?
  • How To Change A Computer’s Mac Address In Windows?
  • How To Defragment The Disk In Windows 7?
  • How To Pin Command Prompt With Admin Rights To Windows Start Menu?
  • How To Add Take Ownership To Right-Click Menu In Windows?
  • How To Add Control Panel To Windows Right Click Menu?
  • How To Change Computer’s IP Address From Command Prompt?
  • How To Set A Custom Startup Folder In Windows File Explorer?

Popular Tutorials

  • How To Change The Background Of a Photo Using Photoshop CS6?
  • How To Remove Watermarks From Photos Using Photoshop CS6 ?
  • How To Download And Install ShareIt On Windows PC?
  • How To Type In Tamil In MS Word
  • How To Get Windows 10 Start Menu In Windows 7?
  • How To Password Protect A Folder In Windows 10?
  • How To Password Protect The Google Form?
  • How To Resolve IP Address Conflict Error In Windows 7?
  • How To Change Computer's IP Address From Command Prompt?
  • How To Install Android Apps On Windows PC

Copyright © 2018 · Free Tech Tutors · All Rights Reserved ®