CodeIgniter Forums
Remove index.php? from URL with question mark | Codeigniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Remove index.php? from URL with question mark | Codeigniter (/showthread.php?tid=79665)



Remove index.php? from URL with question mark | Codeigniter - MTR2021 - 07-16-2021

Hi Dear codeignite forum Community i am newbie in Codeignite coding so i hope you guys give me the time to fix this error thanks is advance Smile
So basically i followed a tutorial here and i disabled index.php from URL that problem was fixed but i still have the remaining question mark ? i tried every tutorial here in codeignite forum eventually i manage to remove the index.php but the question mark remains so how to remove index.php? and finally have example.com/index.php?/signin to example.com/signin without index.php and ? mark
here is my htaccess folder
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

RewriteCond %{QUERY_STRING} ^(.*)i=[^&]+(.*)$ [NC]
RewriteRule ^(.*)$ /$1?%1%2 [R=301,L]
</IfModule>
AddType text/vtt .vtt



RE: Remove index.php? from URL with question mark | Codeigniter - MTR2021 - 07-17-2021

Please someone help me admin or somebody i have not been answered for 2 days now Sad


RE: Remove index.php? from URL with question mark | Codeigniter - MGatner - 07-17-2021

@MTR2021 I’m sorry you haven’t had a response yet. I e read all your messages, but I am not a pro with Apache so don’t have an immediate suggestion.

You might try moving your thread to the Support forum, which is more appropriate for help requests.


RE: Remove index.php? from URL with question mark | Codeigniter - ikesela - 07-17-2021

please use default .htaccess from CI4.

replace this line:
RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]

with this line:
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

Then,set:
App -> Config -> App.php :

public $indexPage = ''; //'index.php';

This is working for me.