.htaccess file in Codeigniter

How to remove index.php in codeigniter

https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-4880246846967300&output=html&h=60&slotname=6239393533&adk=2806349338&adf=1336720979&pi=t.ma~as.6239393533&w=468&lmt=1620970666&psa=1&format=468×60&url=https%3A%2F%2Fscripts.guru%2Fhtaccess-file-in-codeigniter%2F&flash=0&wgl=1&uach=WyJXaW5kb3dzIiwiMTAuMCIsIng4NiIsIiIsIjkwLjAuNDQzMC4yMTIiLFtdXQ..&dt=1620970665878&bpp=5&bdt=7079&idt=164&shv=r20210511&cbv=%2Fr20190131&ptt=9&saldr=aa&abxe=1&cookie=ID%3Dae88d6ef60dfeb51-220624c824c80065%3AT%3D1620881451%3ART%3D1620881451%3AS%3DALNI_MbziyJ-Hxj_TMPSW5tsSHH0KW2DEA&prev_fmts=728×90&correlator=4634344007240&frm=20&pv=1&ga_vid=1477556874.1620554064&ga_sid=1620970666&ga_hid=1897154395&ga_fc=0&u_tz=330&u_his=1&u_java=0&u_h=864&u_w=1536&u_ah=864&u_aw=1536&u_cd=24&u_nplug=3&u_nmime=4&adx=340&ady=482&biw=1519&bih=792&scr_x=0&scr_y=0&oid=3&pvsid=3821632313478264&pem=494&eae=0&fc=640&brdim=0%2C0%2C0%2C0%2C1536%2C0%2C1536%2C864%2C1536%2C792&vis=2&rsz=%7C%7CoeEr%7C&abl=CS&pfx=0&fu=0&bc=31&ifi=2&uci=a!2&fsb=1&xpc=aVgNPPK1XF&p=https%3A//scripts.guru&dtd=194

In this tutorial we are going to learn how to remove index.php from URL using .htaccess file in CodeIgniter. htaccess is the shortened used for Hypertext Access. using this file you can do many things with your website. it is very helpful file. you can also do url rewrite.

Download below code and save .htaccess file

htaccess Code
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Leave a Reply

Your email address will not be published. Required fields are marked *