M
M
mihzas2018-09-21 18:28:08
Apache HTTP Server
mihzas, 2018-09-21 18:28:08

Why is the query giving the wrong result?

.htaccess
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php?$1 [QSA,L]
index.php
<?php
function myAutoLoader(string $className )
{
require_once __DIR__ . '/src/' . str_replace('\\', '/', $className) . '.php';
}
spl_autoload_register('myAutoLoader');
var_dump($_GET['route']);
on request train.com/asd gives train.com/public_html/asd, but should asd

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-09-27
Madzhugin @Suntechnic

Where do you get the route value in GET from?
Why would we show your autoload feature at all if it doesn't affect anything at all?
In fact, you show how to display the values ​​of a variable and ask why it has such and such a value, and not another. How are we supposed to find out interesting? Why should there be asd? Judging by what you show there should be a blank page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question