CodeIgniter Forums

Full Version: Route , remove index.php and use adminer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 ?
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>
(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 ?
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.
(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 ?
Alongside your index.php. It should replace the one you currently are using.