Remove index.php? from URL with question mark | Codeigniter

Hi Dear Infinityfree Community i am newbie in Codeignite coding so i hope you guys give me the time to fix this error thanks is advance :slight_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 Infinityfree 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

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]

AddType text/vtt .vtt

You say you followed a tutorial from here? If you’re using a framework like CodeIgniter, I would highly recommend to just follow CodeIgniter’s instructions on getting pretty URLs instead of copy-pasting .htaccess snippets from other sources.

A quick Google search points me to this article from their official docs:

https://codeigniter.com/userguide3/general/urls.html#removing-the-index-php-file

1 Like

Hi Dear Infinityfree Community i am newbie in Codeignite coding so i hope you guys give me the time to fix this error thanks is advance :slight_smile:

  1. So basically i followed a tutorial here and i disabled index.php from URL that problem was fixed but here is my .htaccess right now and i still have the problem of Example Domain or Example Domain Or /?admin/
<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

But the problem is i followed every single tutorial here in Infinityfree on disabling the name of the controller from URL like /?home/ or /?browse/ and every single controller like /?admin/ show in my URL i want a clean url directly with no controller name or the ? mark in it i tried going to my routes.php to change things in it following tutorials but still same issue remains here is how my routes.php looks like right now

*/
$route['default_controller'] = 'Home';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

Please help me i attempted every single solution but nothing yet, I want to disable the name of the controller from URL like /?home/ or /?browse/ and every single controller like /?admin/ shows in my URL i want a clean url directly with no controller name or the ? mark my controllers are Home, Admin, Browse, General, Payment, Updater can you give examples with them exactly so i can try please to fix the problem according to my controllers

Also, I merged your topics because they are basically the same thing (how to do pretty URLs with CodeIgniter).

That doesn’t deal like something with IF. This would be the article that would help, but you said you already read it.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.