{"id":152,"date":"2025-03-24T11:11:19","date_gmt":"2025-03-24T09:11:19","guid":{"rendered":"https:\/\/www.24x7serverguard.com\/blog\/?p=152"},"modified":"2025-03-24T11:11:19","modified_gmt":"2025-03-24T09:11:19","slug":"how-to-remove-the-php-extension-from-urls","status":"publish","type":"post","link":"https:\/\/www.24x7serverguard.com\/blog\/knowledge\/how-to-remove-the-php-extension-from-urls\/","title":{"rendered":"How to Remove the .php Extension from URLs"},"content":{"rendered":"\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Options +FollowSymLinks<br>Options +Indexes<br>RewriteEngine on<\/mark><\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Redirect requests to PHP files without the .php extension<\/mark><\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">RewriteCond %{SCRIPT_FILENAME} !-d<br>RewriteRule ^([^.]+)$ $1.php [NC,L]<\/mark><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h1 class=\"wp-block-heading has-large-font-size\"><strong>Why Remove <code>.php<\/code> from URLs?<\/strong><\/h1>\n\n\n\n<p><strong>Improves Readability<\/strong> \u2013 Shorter, cleaner URLs enhance user experience.<\/p>\n\n\n\n<p><strong>SEO Benefits<\/strong> \u2013 Search engines prefer simple and structured URLs.<\/p>\n\n\n\n<p><strong>Future-Proofing<\/strong> \u2013 If you switch technologies, URLs remain consistent.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Options +FollowSymLinksOptions +IndexesRewriteEngine on Redirect requests to PHP files without the .php extension RewriteCond %{SCRIPT_FILENAME} !-dRewriteRule ^([^.]+)$ $1.php [NC,L] Why Remove .php from URLs? Improves Readability \u2013 Shorter, cleaner URLs enhance user experience. SEO Benefits \u2013 Search engines prefer simple and structured URLs. Future-Proofing \u2013 If you switch technologies, URLs remain consistent.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[92,91,90],"class_list":["post-152","post","type-post","status-publish","format-standard","hentry","category-knowledge","tag-htaccess","tag-extension","tag-php"],"_links":{"self":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/comments?post=152"}],"version-history":[{"count":1,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/152\/revisions"}],"predecessor-version":[{"id":153,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/152\/revisions\/153"}],"wp:attachment":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/media?parent=152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/categories?post=152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/tags?post=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}