Answer the question
In order to leave comments, you need to log in
How to make Submit form (html) GET given htaccess location?
there is such a rule for nginx
location / {
rewrite ^/([a-zA-Z0-9_-]+)\.txt$ /index.php?name=$1;
}
Answer the question
In order to leave comments, you need to log in
At you for certain in the form there is simply action="".
Make it in JS so that the action attribute of the form is assigned dynamically depending on the parameters and conditions, as you need.
$path = "http://example.com/index.php";
if (isset($_GET['name'])) header("Location: {$path}/{$_GET['name']}");
$url = basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
// /index.php/test в переменной будет test
// парсит все, что идет после последнего слэша
// редирект не тестил
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question