{"id":1975,"date":"2020-10-27T07:10:42","date_gmt":"2020-10-27T07:10:42","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=1975"},"modified":"2025-08-25T04:28:02","modified_gmt":"2025-08-25T04:28:02","slug":"how-to-remove-index-php-from-url","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/","title":{"rendered":"How to Remove index.php from URL"},"content":{"rendered":"\n<p>By default, PHP platforms such as WordPress and Codeigniter append index.php at the end of website URL, which is not really required. Often site administrators and web developers need to remove it from all their URLs. You can easily remove index.php from URL using .htaccess (mod_rewrite) in Apache web server. You can use these steps to remove index.php from WordPress, Codeigniter and other PHP websites.<\/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-index-php-from-url\/#Why_Remove_indexphp_from_URL\" >Why Remove index.php 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-index-php-from-url\/#How_to_Remove_indexphp_from_URL\" >How to Remove index.php 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-index-php-from-url\/#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-index-php-from-url\/#2_Remove_indexphp_from_URL\" >2. Remove index.php 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-index-php-from-url\/#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-index-php-from-url\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Remove_indexphp_from_URL\"><\/span>Why Remove index.php from URL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>By default, whenever you run a PHP site on Apache server, or any other web server, the URL of your site&#8217;s home page will end with index.php. This is true even if you use a PHP-based web development framework such as CodeIgniter. Therefore, all other URLs on your website will automatically contain index.php. For example, if your site is https:\/\/mysite.com, its home page URL will be https:\/\/mysite.com\/index.php. This is not required since it is difficult to remember URLs with index.php in them. Also it reveals that your site runs on PHP. This might attract malicious attackers who exploit its vulnerabilities.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Remove_indexphp_from_URL\"><\/span>How to Remove index.php from URL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We will basically redirect the index.php to URL without it, that is, from https:\/\/mysite.com\/index.php to https:\/\/mysite.com. For that we will need mod_rewrite Apache module. mod_rewrite allows you to setup URL redirection and rewrite rules without modifying the main server configuration or virtual host files. In many hosting environments, you may not have access to the main configuration file or virtual host file. So it is important that you use .htaccess file for URL redirection.<\/p>\n\n\n\n<p>Before proceeding further, please ensure that you have enabled mod_rewrite in Apache web server. Here are the steps to enable mod_rewrite in Apache. At the end of it, you will have created a .htaccess file for your website.<\/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 commands to open .htaccess file. We have used the default file path of .htaccess file. You can change it as per your requirement. Please note, you need to create or open .htaccess file present at the root folder of your website. If it is different from \/var\/www\/html, please update the file path in the command below accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/var\/www\/html\/.htaccess<\/pre>\n\n\n\n<p>Bonus Read : <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-fail2ban-to-protect-apache-server\/\">How to Install Fail2Ban in Apache<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Remove_indexphp_from_URL\"><\/span>2. Remove index.php from URL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Add the following lines in .htaccess file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>RewriteEngine On<\/code>\n<code>RewriteCond %{REQUEST_FILENAME} !-f<\/code>\n<code>RewriteCond %{REQUEST_FILENAME} !-d<\/code>\n<code>RewriteRule ^(.*)$ index.php\/$1 [L]<\/code><\/pre>\n\n\n\n<p>Let us look at each line above. The first line enables mod_rewrite if it is not enabled already.<\/p>\n\n\n\n<p>The second line matches URLs that are not files. The third line matches URLs that are not directories. So we are looking to match URLs that are neither files nor directories.<\/p>\n\n\n\n<p>The last line means that if the two RewriteCond statements before it are matched for a URL, then it will be redirected to URL without index.php in it.<\/p>\n\n\n\n<p>Similarly, you can also <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-php-from-url-in-apache-wordpress\/\">remove .php from URL<\/a> in Apache by replacing index.php with just .php in the above code.<\/p>\n\n\n\n<p>Bonus Read : <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-memcached-in-apache\/\">How to Install memcached in Apache<\/a><\/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 to apply changes<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$&nbsp;sudo systemctl restart httpd<\/pre>\n\n\n\n<p>Now if you open browser and visit http:\/\/<em>your_domain_or_IP<\/em>\/index.php you will be redirected to http:\/\/<em>your_domain_or_IP<\/em>. Replace <em>your_domain_or_IP<\/em> with your domain or IP address. Similarly, if you visit URL like http:\/\/<em>your_domain_or_IP<\/em>\/index.php\/folder1\/folder2 you will be redirected to http:\/\/<em>your_domain_or_IP<\/em>\/folder1\/folder2<\/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 index.php from all URLs on our website. They are applicable whether no matter which PHP-based platform you use such as WordPress, Joomla, Drupal, CodeIgniter, etc. It is advisable to make this change when you start hosting your website itself, instead of adding it later on. This will help search engines properly index the right URL and also help users remember them easily.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, php websites and blogs display index.php at end of URL. Here is how to remove index.php from URL.<\/p>\n","protected":false},"author":1,"featured_media":1985,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[206,65],"class_list":["post-1975","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","tag-index-php","tag-mod_rewrite"],"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 index.php from URL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"By default, php websites and blogs display index.php at end of URL. Here is how to remove index.php from URL in PHP, Wordpress, Codeigniter and Apache.\" \/>\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-index-php-from-url\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Remove index.php from URL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"By default, php websites and blogs display index.php at end of URL. Here is how to remove index.php from URL in PHP, Wordpress, Codeigniter and Apache.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/\" \/>\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-10-27T07:10:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-25T04:28:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/How-to-Remove-Index_php-from-URL-in-PHP.png\" \/>\n\t<meta property=\"og:image:width\" content=\"940\" \/>\n\t<meta property=\"og:image:height\" content=\"370\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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-index-php-from-url\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Remove index.php from URL\",\"datePublished\":\"2020-10-27T07:10:42+00:00\",\"dateModified\":\"2025-08-25T04:28:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/\"},\"wordCount\":663,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/How-to-Remove-Index_php-from-URL-in-PHP.png?fit=940%2C370&ssl=1\",\"keywords\":[\"index.php\",\"mod_rewrite\"],\"articleSection\":[\"Apache\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/\",\"name\":\"How to Remove index.php from URL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/How-to-Remove-Index_php-from-URL-in-PHP.png?fit=940%2C370&ssl=1\",\"datePublished\":\"2020-10-27T07:10:42+00:00\",\"dateModified\":\"2025-08-25T04:28:02+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"By default, php websites and blogs display index.php at end of URL. Here is how to remove index.php from URL in PHP, Wordpress, Codeigniter and Apache.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/How-to-Remove-Index_php-from-URL-in-PHP.png?fit=940%2C370&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/How-to-Remove-Index_php-from-URL-in-PHP.png?fit=940%2C370&ssl=1\",\"width\":940,\"height\":370,\"caption\":\"how to remove index.php from URL in apache\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-remove-index-php-from-url\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Remove index.php from URL\"}]},{\"@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 index.php from URL - Ubiq BI","description":"By default, php websites and blogs display index.php at end of URL. Here is how to remove index.php from URL in PHP, Wordpress, Codeigniter and Apache.","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-index-php-from-url\/","og_locale":"en_US","og_type":"article","og_title":"How to Remove index.php from URL - Ubiq BI","og_description":"By default, php websites and blogs display index.php at end of URL. Here is how to remove index.php from URL in PHP, Wordpress, Codeigniter and Apache.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-10-27T07:10:42+00:00","article_modified_time":"2025-08-25T04:28:02+00:00","og_image":[{"width":940,"height":370,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/How-to-Remove-Index_php-from-URL-in-PHP.png","type":"image\/png"}],"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-index-php-from-url\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Remove index.php from URL","datePublished":"2020-10-27T07:10:42+00:00","dateModified":"2025-08-25T04:28:02+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/"},"wordCount":663,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/How-to-Remove-Index_php-from-URL-in-PHP.png?fit=940%2C370&ssl=1","keywords":["index.php","mod_rewrite"],"articleSection":["Apache"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/","name":"How to Remove index.php from URL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/How-to-Remove-Index_php-from-URL-in-PHP.png?fit=940%2C370&ssl=1","datePublished":"2020-10-27T07:10:42+00:00","dateModified":"2025-08-25T04:28:02+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"By default, php websites and blogs display index.php at end of URL. Here is how to remove index.php from URL in PHP, Wordpress, Codeigniter and Apache.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/How-to-Remove-Index_php-from-URL-in-PHP.png?fit=940%2C370&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/How-to-Remove-Index_php-from-URL-in-PHP.png?fit=940%2C370&ssl=1","width":940,"height":370,"caption":"how to remove index.php from URL in apache"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Remove index.php from URL"}]},{"@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\/10\/How-to-Remove-Index_php-from-URL-in-PHP.png?fit=940%2C370&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-vR","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1975","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=1975"}],"version-history":[{"count":22,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1975\/revisions"}],"predecessor-version":[{"id":9264,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1975\/revisions\/9264"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/1985"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=1975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=1975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=1975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}