Back to Browse

How to Remove .html & .php extension from URL Using .htaccess (Step-by-Step Guide)

37 views
Apr 5, 2026
5:32

Want clean, professional, and SEO-friendly URLs for your website? In this step-by-step tutorial, you'll learn how to remove .html and .php extensions from your URLs using the .htaccess file. This method works on Apache servers and helps improve user experience, URL readability, and search engine optimization. πŸ”§ In This Video, You'll Learn: What .htaccess is and how it works How to remove .html and .php extensions How to redirect old URLs to new ones properly Common mistakes to avoid πŸ’» Code Used: RewriteEngine On πŸ‘‰ Remove .php extension .htaccess code RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php-f RewriteRule ^(.*)$ $1.php πŸ‘‰ Remove .html extension .htaccess code RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule ^(.*)$ $1.html πŸš€ Benefits of Clean URLs: βœ” Better SEO rankings βœ” Improved user experience βœ” Cleaner and more professional links πŸ“Œ Example: Before: πŸ‘‰ yourwebsite.com/page.php πŸ‘‰ yourwebsite.com/about.html After: πŸ‘‰ yourwebsite.com/page πŸ‘‰ yourwebsite.com/about Social Links:- Website : https://www.stilllearning.in YouTube : https://www.youtube.com/@StillLearning Facebook : https://www.facebook.com/stilllearning.in Twitter : https://twitter.com/stilllearningin πŸ”₯ Don’t forget to Like πŸ‘, Share πŸ”, and Subscribe πŸ”” for more CSS animations, web design tutorials, and creative coding tips! #removehtmlextension #removephpextension #htaccess #seofriendlyurls

Download

0 formats

No download links available.

How to Remove .html & .php extension from URL Using .htaccess (Step-by-Step Guide) | NatokHD