How to Remove .html & .php extension from URL Using .htaccess (Step-by-Step Guide)
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 formatsNo download links available.