Welcome Guest, Not a member yet? Register   Sign In
Route , remove index.php and use adminer
#1

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 ?
Reply
#2

(This post was last modified: 11-25-2018, 03:14 AM by jreklund.)

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>
Reply
#3

(This post was last modified: 11-27-2018, 10:49 AM by pippuccio76.)

(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 ?
Reply
#4

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.
Reply
#5

(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 ?
Reply
#6

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




Theme © iAndrew 2016 - Forum software by © MyBB