1

When i type localhost/myproject/about/garbage/blababla/about/qwertyu/adsfgad/about

It WORKS (beacause my code only reads the last entry (about)), but... previous entries remain in the url (about/garbage/blababla/about/qwertyu/adsfgad)

When i try this on wordpress, the framework also pick the last entry, but rewrite url removing previous garbage

How to erase previous user entries garbages?

My Route code

define('ROUTE', basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));
define('ROOT', basename(dirname(__DIR__)));
switch (ROUTE)
{
    case ROOT:
        require_once __DIR__.'/view/login.php';
        break;
    case 'about':
        require_once __DIR__.'/view/about.php';
        break;
    default:
        http_response_code(404);
        break;
};

My .htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
matheba
  • 11
  • 1
  • Does this answer your question? [URL rewriting with PHP](https://stackoverflow.com/questions/16388959/url-rewriting-with-php) – René Höhle Nov 23 '19 at 22:15

0 Answers0