{"id":1649,"date":"2020-09-17T05:37:07","date_gmt":"2020-09-17T05:37:07","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=1649"},"modified":"2025-08-22T03:53:37","modified_gmt":"2025-08-22T03:53:37","slug":"how-to-remove-php-from-url-in-apache-wordpress","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/","title":{"rendered":"How to Remove .php from URL in Apache\/WordPress"},"content":{"rendered":"\n<p>Millions of websites run on PHP platform. Most blogs use WordPress which also uses PHP. When you are running a PHP-based website, then by default, your web server such as Apache server adds .php to URL for PHP files. This is not user-friendly since they need to remember to add .php extension to all requests.  If they omit it, then they may get 404:Page Not Found error message. So it is recommended to remove URL extensions from your website. Here&#8217;s how to remove .php from URL in Apache. You can use these steps to remove .php from URL in WordPress, Magento, Drupal, Joomla and other CMS systems. You can also use it to remove index.php from URLs.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#Why_Remove_php_extension_from_URL\" >Why Remove .php extension from URL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#Remove_php_extension_from_URL\" >Remove .php extension from URL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#1_Open_htaccess_file\" >1. Open htaccess file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#2_Remove_php_extension_from_URL\" >2. Remove .php extension from URL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#3_Restart_Apache_web_server\" >3. Restart Apache web server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#4_Verify_Changes\" >4. Verify Changes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Remove_php_extension_from_URL\"><\/span>Why Remove .php extension from URL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Typically, every PHP website&#8217;s URLs contain .php extension. Your web server treats the URL with and without .php extension differently. By default, it is configured to serve requests with .php URL extension. If users do not include this extension in their requests, then your web server will return &#8216;Page Not Found&#8217; error. Also, it can be tedious for users to remember URL extensions for all URLs. Also, if any malicious user or bot visits your site, they can easily guess your site technology just by looking at the URL extension, and then exploit its vulnerabilities. Therefore, it is essential to remove .php extension from URL as soon as you launch your site or blog, if not later.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Remove_php_extension_from_URL\"><\/span>Remove .php extension from URL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Before proceeding further, you need to enable mod_rewrite in Apache web server. Here are the steps to enable mod_rewrite (.htaccess) in Apache web server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Open_htaccess_file\"><\/span>1. Open htaccess file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Open terminal and run the following command to open <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/howto\/htaccess.html\" target=\"_blank\" rel=\"noreferrer noopener\">.htaccess<\/a> file. Please change the file path to .htaccess file as per your requirement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/var\/www\/html\/.htaccess<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Remove_php_extension_from_URL\"><\/span>2. Remove .php extension from URL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Add the following lines to redirect all URLs with .php extension to URLs without file extension.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_FILENAME}\\.php -f\nRewriteRule ^(.*)$ $1.php [NC,L] <\/pre>\n\n\n\n<p>In the above code, the first line checks that the request is a URL and not a directory. The second line redirect matching URLs with .php extension to those without file extension. The last line redirects matching requests to URLs without php file extension.<\/p>\n\n\n\n<p>Similarly, you may also add the following code to remove .html extension from URL.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>RewriteCond %{REQUEST_FILENAME} !-d <\/code>\n<code>RewriteCond %{REQUEST_FILENAME}\\.html -f <\/code>\n<code>RewriteRule ^(.*)$ $1.html [NC,L]<\/code><\/pre>\n\n\n\n<p>These are similar to <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/\">removing index.php<\/a> from Apache\/PHP websites.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Restart_Apache_web_server\"><\/span>3. Restart Apache web server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Restart Apache server with following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$&nbsp;sudo systemctl restart httpd<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Verify_Changes\"><\/span>4. Verify Changes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Open web browser and request any URL from your website, with .php extension. You should be redirected to the page without this extension.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt how to remove .php URL extension in Apache\/Wordpress sites. You can use the same method for all PHP based sites, that run on Apache server. If you do not redirect URLs with .php extension to those without, then your server will see these two URLs as separate. In such cases, it will return &#8216;Page Not Found&#8217; error when you do not include .php extension. Please note, the approach remains the same even if you are using another web server &#8211; you need to redirect all URLs with extension, to those without extension.<\/p>\n\n\n\n<p><a href=\"http:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data in minutes, and monitor in real-time dashboards.&nbsp;<a href=\"http:\/\/ubiq.co\/accounts\/register\">Try it<\/a>&nbsp;Today!<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-ubuntu\/\">How to Install Varnish in Ubuntu<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/fix-503-service-temporarily-unavailable-error-apache\/\">How to Fix 503 Service Unavailable in Apache<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/fix-500-internal-server-error-apache\/\">How to Fix 500 Internal Server Error in Apache<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you may need to remove .php from URL in Apache web server. Here&#8217;s how to remove .php from URL in Apache, Wordpress, Magento and other CMS systems.<\/p>\n","protected":false},"author":1,"featured_media":1653,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,10],"tags":[185],"class_list":["post-1649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","category-website-administration","tag-remove-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Remove .php from URL in Apache\/Wordpress - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Sometimes you may need to remove .php from URL in Apache web server. Here&#039;s how to remove .php from URL in Apache, Wordpress, Magento.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Remove .php from URL in Apache\/Wordpress - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Sometimes you may need to remove .php from URL in Apache web server. Here&#039;s how to remove .php from URL in Apache, Wordpress, Magento.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-17T05:37:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-22T03:53:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/09\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Remove .php from URL in Apache\\\/WordPress\",\"datePublished\":\"2020-09-17T05:37:07+00:00\",\"dateModified\":\"2025-08-22T03:53:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/\"},\"wordCount\":575,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg?fit=1200%2C900&ssl=1\",\"keywords\":[\"remove .php\"],\"articleSection\":[\"Apache\",\"Website Administration\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/\",\"name\":\"How to Remove .php from URL in Apache\\\/Wordpress - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg?fit=1200%2C900&ssl=1\",\"datePublished\":\"2020-09-17T05:37:07+00:00\",\"dateModified\":\"2025-08-22T03:53:37+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Sometimes you may need to remove .php from URL in Apache web server. Here's how to remove .php from URL in Apache, Wordpress, Magento.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg?fit=1200%2C900&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg?fit=1200%2C900&ssl=1\",\"width\":1200,\"height\":900,\"caption\":\"remove .php extension from URL\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-php-from-url-in-apache-wordpress\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Remove .php from URL in Apache\\\/WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Remove .php from URL in Apache\/Wordpress - Ubiq BI","description":"Sometimes you may need to remove .php from URL in Apache web server. Here's how to remove .php from URL in Apache, Wordpress, Magento.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to Remove .php from URL in Apache\/Wordpress - Ubiq BI","og_description":"Sometimes you may need to remove .php from URL in Apache web server. Here's how to remove .php from URL in Apache, Wordpress, Magento.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-09-17T05:37:07+00:00","article_modified_time":"2025-08-22T03:53:37+00:00","og_image":[{"width":1200,"height":900,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/09\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Remove .php from URL in Apache\/WordPress","datePublished":"2020-09-17T05:37:07+00:00","dateModified":"2025-08-22T03:53:37+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/"},"wordCount":575,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/09\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg?fit=1200%2C900&ssl=1","keywords":["remove .php"],"articleSection":["Apache","Website Administration"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/","name":"How to Remove .php from URL in Apache\/Wordpress - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/09\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg?fit=1200%2C900&ssl=1","datePublished":"2020-09-17T05:37:07+00:00","dateModified":"2025-08-22T03:53:37+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Sometimes you may need to remove .php from URL in Apache web server. Here's how to remove .php from URL in Apache, Wordpress, Magento.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/09\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg?fit=1200%2C900&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/09\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg?fit=1200%2C900&ssl=1","width":1200,"height":900,"caption":"remove .php extension from URL"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Remove .php from URL in Apache\/WordPress"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/09\/Remove-File-Extension-php-html-from-URL-using-htaccess.jpg?fit=1200%2C900&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-qB","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=1649"}],"version-history":[{"count":15,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1649\/revisions"}],"predecessor-version":[{"id":9239,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1649\/revisions\/9239"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/1653"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=1649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=1649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=1649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}