CodeIgniter Forums
Route , remove index.php and use adminer - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Route , remove index.php and use adminer (/showthread.php?tid=72230)



Route , remove index.php and use adminer - pippuccio76 - 11-25-2018

Hi sorry for english, i use adminer to manage my database.
I insert it on root and if i wante use it i go to mydomain/adminer.php

If i want remove index.php im ust insert the htaccess on root :

Code:
RewriteEngine on
RewriteBase    /
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

And the sistem work . But i cannot use asminer because i have a 404 page .

How can i solve it ?


RE: Route , remove index.php and use adminer - jreklund - 11-25-2018

Have a go with this one instead. It check if it's an actual file or folder. If that's the case. Don't redirect it to index.php.

Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>



RE: Route , remove index.php and use adminer - pippuccio76 - 11-27-2018

(11-25-2018, 03:14 AM)jreklund Wrote: Have a go with this one instead. It check if it's an actual file or folder. If that's the case. Don't redirect it to index.php.

Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

REQUEST_FILENAME is my adminer.php ?


RE: Route , remove index.php and use adminer - jreklund - 11-27-2018

It should look exactly like that. %{REQUEST_FILENAME} are an internal name in Apache and gets translated into whatever file you try to open.

E.g. adminer.php gets translated into.
RewriteCond adminer.php !-f
RewriteCond adminer.php !-d

E.g. myamazingfile.php gets translated into.
RewriteCond myamazingfile.php !-f
RewriteCond myamazingfile.php !-d

So that you don't need to add hundreds of lines.


RE: Route , remove index.php and use adminer - pippuccio76 - 11-28-2018

(11-27-2018, 11:15 AM)jreklund Wrote: It should look exactly like that. %{REQUEST_FILENAME} are an internal name in Apache and gets translated into whatever file you try to open.

E.g. adminer.php gets translated into.
RewriteCond adminer.php !-f
RewriteCond adminer.php !-d

E.g. myamazingfile.php gets translated into.
RewriteCond myamazingfile.php !-f
RewriteCond myamazingfile.php !-d

So that you don't need to add hundreds of lines.

Where must i put  this htaccess ? in root or in application or both ?


RE: Route , remove index.php and use adminer - jreklund - 11-28-2018

Alongside your index.php. It should replace the one you currently are using.