{"id":442,"date":"2019-04-05T13:37:19","date_gmt":"2019-04-05T08:07:19","guid":{"rendered":"https:\/\/webdesignerinc.com\/blog\/?p=442"},"modified":"2019-04-05T13:38:35","modified_gmt":"2019-04-05T08:08:35","slug":"how-to-remove-index-php-from-urls-in-codeigniter","status":"publish","type":"post","link":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/","title":{"rendered":"How to remove index.php from URLs in CodeIgniter"},"content":{"rendered":"<p>For Localhost \/ VPS \/ Dedicated Hosting<\/p>\n<ol>\n<li>Open the\u00a0<strong>httpd.conf<\/strong><\/li>\n<li>Find<br \/>\n<code>LoadModule rewrite_module modules\/mod_rewrite.so<\/code><\/li>\n<li>Remove # from the beginning of the line<\/li>\n<li>Find AllowOverride then change to be<br \/>\n<code>&lt;Directory \/&gt;<br \/>\nAllowOverride All<br \/>\nOrder deny,allow<br \/>\nDeny from all<br \/>\n&lt;\/Directory&gt;<\/code><\/li>\n<li>Save and restart Apache<\/li>\n<li>Create a\u00a0<strong>.htaccess<\/strong>\u00a0file at the root directory<br \/>\n<code>#Rewrite index.php<br \/>\n#Start using rewrite engine<br \/>\nRewriteEngine On<br \/>\n#Rewrite condition<br \/>\nRewriteCond %{REQUEST_FILENAME} !-f<br \/>\nRewriteCond %{REQUEST_FILENAME} !-d<br \/>\n#Whenever index.php is there in the url, it will rewrite to \/ automatically<br \/>\nRewriteRule .* index.php\/$0 [PT,L]<\/code><\/li>\n<li>Make following changes in\u00a0<strong>application\/config.php<br \/>\n<\/strong><code>$config['index_page'] = '';<\/code><\/li>\n<li>Save the file and you are done<\/li>\n<\/ol>\n<p><strong>For shared hosting<\/strong><\/p>\n<ol>\n<li>Create a\u00a0<strong>.htaccess<\/strong>\u00a0file at the root directory<br \/>\n<code>#Rewrite index.php<br \/>\n#Start using rewrite engine<br \/>\nRewriteEngine On<br \/>\n#Rewrite condition<br \/>\nRewriteCond %{REQUEST_FILENAME} !-f<br \/>\nRewriteCond %{REQUEST_FILENAME} !-d<br \/>\n#Whenever index.php is there in the url, it will rewrite to \/ automatically<br \/>\nRewriteRule .* index.php\/$0 [PT,L]<\/code><\/li>\n<li>Make following changes in\u00a0<strong>application\/config.php<br \/>\n<\/strong><code>$config['index_page'] = '';<\/code><\/li>\n<li>Save the file and you are done<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>For Localhost \/ VPS \/ Dedicated Hosting Open the\u00a0httpd.conf Find LoadModule rewrite_module modules\/mod_rewrite.so Remove # from the beginning of the line Find AllowOverride then change to be &lt;Directory \/&gt; AllowOverride&#8230; <a class=\"read-more-link\" href=\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":390,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[26,25],"class_list":["post-442","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial","tag-codeigniter","tag-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to remove index.php from URLs in CodeIgniter - Web designer Blog | web designer<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/\" \/>\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 URLs in CodeIgniter - Web designer Blog | web designer\" \/>\n<meta property=\"og:description\" content=\"For Localhost \/ VPS \/ Dedicated Hosting Open the\u00a0httpd.conf Find LoadModule rewrite_module modules\/mod_rewrite.so Remove # from the beginning of the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/\" \/>\n<meta property=\"og:site_name\" content=\"Web designer Blog | web designer\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Webdesignerinc\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-05T08:07:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-05T08:08:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/12\/3-Best-PHP-Framework-CodeIgniter.png\" \/>\n\t<meta property=\"og:image:width\" content=\"530\" \/>\n\t<meta property=\"og:image:height\" content=\"303\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Teji\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@teji_tejinder\" \/>\n<meta name=\"twitter:site\" content=\"@teji_tejinder\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Teji\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/\"},\"author\":{\"name\":\"Teji\",\"@id\":\"https:\/\/webdesignerinc.com\/blog\/#\/schema\/person\/5e2f01e80461d9a5ca3c361b86f405e7\"},\"headline\":\"How to remove index.php from URLs in CodeIgniter\",\"datePublished\":\"2019-04-05T08:07:19+00:00\",\"dateModified\":\"2019-04-05T08:08:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/\"},\"wordCount\":83,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webdesignerinc.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/12\/3-Best-PHP-Framework-CodeIgniter.png\",\"keywords\":[\"CodeIgniter\",\"PHP\"],\"articleSection\":[\"Tutorial\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/\",\"url\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/\",\"name\":\"How to remove index.php from URLs in CodeIgniter - Web designer Blog | web designer\",\"isPartOf\":{\"@id\":\"https:\/\/webdesignerinc.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/12\/3-Best-PHP-Framework-CodeIgniter.png\",\"datePublished\":\"2019-04-05T08:07:19+00:00\",\"dateModified\":\"2019-04-05T08:08:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#primaryimage\",\"url\":\"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/12\/3-Best-PHP-Framework-CodeIgniter.png\",\"contentUrl\":\"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/12\/3-Best-PHP-Framework-CodeIgniter.png\",\"width\":530,\"height\":303},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webdesignerinc.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to remove index.php from URLs in CodeIgniter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webdesignerinc.com\/blog\/#website\",\"url\":\"https:\/\/webdesignerinc.com\/blog\/\",\"name\":\"Web designer Blog | web designer\",\"description\":\"Web Designer and Developer Blog\",\"publisher\":{\"@id\":\"https:\/\/webdesignerinc.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webdesignerinc.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webdesignerinc.com\/blog\/#organization\",\"name\":\"Web designer Blog | web designer\",\"url\":\"https:\/\/webdesignerinc.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webdesignerinc.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/09\/logo1.png\",\"contentUrl\":\"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/09\/logo1.png\",\"width\":409,\"height\":80,\"caption\":\"Web designer Blog | web designer\"},\"image\":{\"@id\":\"https:\/\/webdesignerinc.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Webdesignerinc\",\"https:\/\/x.com\/teji_tejinder\",\"http:\/\/www.linkedin.com\/in\/tejinder-singh-97bb19115\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webdesignerinc.com\/blog\/#\/schema\/person\/5e2f01e80461d9a5ca3c361b86f405e7\",\"name\":\"Teji\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/3933d592d4425623e44a3ddce18ae04f785295e0dd9b8b9d99251e81a0544a52?s=96&r=g&d=https:\/\/webdesignerinc.com\/blog\/wp-content\/plugins\/userswp\/assets\/images\/no_profile.png\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3933d592d4425623e44a3ddce18ae04f785295e0dd9b8b9d99251e81a0544a52?s=96&r=g&d=https:\/\/webdesignerinc.com\/blog\/wp-content\/plugins\/userswp\/assets\/images\/no_profile.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3933d592d4425623e44a3ddce18ae04f785295e0dd9b8b9d99251e81a0544a52?s=96&r=g&d=https:\/\/webdesignerinc.com\/blog\/wp-content\/plugins\/userswp\/assets\/images\/no_profile.png\",\"caption\":\"Teji\"},\"description\":\"i am admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to remove index.php from URLs in CodeIgniter - Web designer Blog | web designer","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:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/","og_locale":"en_US","og_type":"article","og_title":"How to remove index.php from URLs in CodeIgniter - Web designer Blog | web designer","og_description":"For Localhost \/ VPS \/ Dedicated Hosting Open the\u00a0httpd.conf Find LoadModule rewrite_module modules\/mod_rewrite.so Remove # from the beginning of the","og_url":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/","og_site_name":"Web designer Blog | web designer","article_publisher":"https:\/\/www.facebook.com\/Webdesignerinc","article_published_time":"2019-04-05T08:07:19+00:00","article_modified_time":"2019-04-05T08:08:35+00:00","og_image":[{"width":530,"height":303,"url":"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/12\/3-Best-PHP-Framework-CodeIgniter.png","type":"image\/png"}],"author":"Teji","twitter_card":"summary_large_image","twitter_creator":"@teji_tejinder","twitter_site":"@teji_tejinder","twitter_misc":{"Written by":"Teji","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#article","isPartOf":{"@id":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/"},"author":{"name":"Teji","@id":"https:\/\/webdesignerinc.com\/blog\/#\/schema\/person\/5e2f01e80461d9a5ca3c361b86f405e7"},"headline":"How to remove index.php from URLs in CodeIgniter","datePublished":"2019-04-05T08:07:19+00:00","dateModified":"2019-04-05T08:08:35+00:00","mainEntityOfPage":{"@id":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/"},"wordCount":83,"commentCount":0,"publisher":{"@id":"https:\/\/webdesignerinc.com\/blog\/#organization"},"image":{"@id":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#primaryimage"},"thumbnailUrl":"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/12\/3-Best-PHP-Framework-CodeIgniter.png","keywords":["CodeIgniter","PHP"],"articleSection":["Tutorial"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/","url":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/","name":"How to remove index.php from URLs in CodeIgniter - Web designer Blog | web designer","isPartOf":{"@id":"https:\/\/webdesignerinc.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#primaryimage"},"image":{"@id":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#primaryimage"},"thumbnailUrl":"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/12\/3-Best-PHP-Framework-CodeIgniter.png","datePublished":"2019-04-05T08:07:19+00:00","dateModified":"2019-04-05T08:08:35+00:00","breadcrumb":{"@id":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#primaryimage","url":"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/12\/3-Best-PHP-Framework-CodeIgniter.png","contentUrl":"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/12\/3-Best-PHP-Framework-CodeIgniter.png","width":530,"height":303},{"@type":"BreadcrumbList","@id":"https:\/\/webdesignerinc.com\/blog\/how-to-remove-index-php-from-urls-in-codeigniter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webdesignerinc.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to remove index.php from URLs in CodeIgniter"}]},{"@type":"WebSite","@id":"https:\/\/webdesignerinc.com\/blog\/#website","url":"https:\/\/webdesignerinc.com\/blog\/","name":"Web designer Blog | web designer","description":"Web Designer and Developer Blog","publisher":{"@id":"https:\/\/webdesignerinc.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webdesignerinc.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webdesignerinc.com\/blog\/#organization","name":"Web designer Blog | web designer","url":"https:\/\/webdesignerinc.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdesignerinc.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/09\/logo1.png","contentUrl":"https:\/\/webdesignerinc.com\/blog\/wp-content\/uploads\/2017\/09\/logo1.png","width":409,"height":80,"caption":"Web designer Blog | web designer"},"image":{"@id":"https:\/\/webdesignerinc.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Webdesignerinc","https:\/\/x.com\/teji_tejinder","http:\/\/www.linkedin.com\/in\/tejinder-singh-97bb19115"]},{"@type":"Person","@id":"https:\/\/webdesignerinc.com\/blog\/#\/schema\/person\/5e2f01e80461d9a5ca3c361b86f405e7","name":"Teji","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3933d592d4425623e44a3ddce18ae04f785295e0dd9b8b9d99251e81a0544a52?s=96&r=g&d=https:\/\/webdesignerinc.com\/blog\/wp-content\/plugins\/userswp\/assets\/images\/no_profile.png","url":"https:\/\/secure.gravatar.com\/avatar\/3933d592d4425623e44a3ddce18ae04f785295e0dd9b8b9d99251e81a0544a52?s=96&r=g&d=https:\/\/webdesignerinc.com\/blog\/wp-content\/plugins\/userswp\/assets\/images\/no_profile.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3933d592d4425623e44a3ddce18ae04f785295e0dd9b8b9d99251e81a0544a52?s=96&r=g&d=https:\/\/webdesignerinc.com\/blog\/wp-content\/plugins\/userswp\/assets\/images\/no_profile.png","caption":"Teji"},"description":"i am admin"}]}},"_links":{"self":[{"href":"https:\/\/webdesignerinc.com\/blog\/wp-json\/wp\/v2\/posts\/442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webdesignerinc.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webdesignerinc.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webdesignerinc.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webdesignerinc.com\/blog\/wp-json\/wp\/v2\/comments?post=442"}],"version-history":[{"count":0,"href":"https:\/\/webdesignerinc.com\/blog\/wp-json\/wp\/v2\/posts\/442\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webdesignerinc.com\/blog\/wp-json\/wp\/v2\/media\/390"}],"wp:attachment":[{"href":"https:\/\/webdesignerinc.com\/blog\/wp-json\/wp\/v2\/media?parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webdesignerinc.com\/blog\/wp-json\/wp\/v2\/categories?post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webdesignerinc.com\/blog\/wp-json\/wp\/v2\/tags?post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}