Hey! I have a question please. First of all let me explain, My server dosn't accept .htaccess, they using nginx, and I don't have access to nginx files too.
Now, I want to make custom urls for my custom website, but there is a problem, I don't want everything to be to the main root (www). I want to put the files inside the folders, but still I want the urls to be diffrent.
I want the login page to be in specific folder with the name access, but I want the visitor to see it like: .com/login and no .com/access/login.
I found a solution to change the 404.php see bellow to understand:
<?php
require_once 'inc/routes.php';
$request_uri = $_SERVER['REQUEST_URI'];
if ($request_uri == '/') {
// Show the homepage
include('index.php');
} elseif ($request_uri == '/login') {
// Show the about page
include('access/login.php');
} else {
// Show a 404 error
http_response_code(404);
include('error.php');
}
?>
That supose to do what I have in my mind, and works I see the page, but the problem is the buttons stop working.
The user see /login on the search bar, but the real name of the page is 404.php and the login.php file cannot submit any request because actually the login change to 404.
So the buttons dosn't work.
There is any other way to make custom links, to put every php file in specific folder, but still use custom url to navigate the users there?
Or to do something in action of submit, to forward the proccess, to complete the proccess, but the user not see any diffrence to the url?