G
G
Gene Hagmt2019-06-16 14:59:19
PHP
Gene Hagmt, 2019-06-16 14:59:19

How to make the web server (Apache) not search for pages at the entered URL, but delegate this task to the router?

Typically, the router checks the URL against a certain list of available addresses, but if the addresses in the list are not real directories, then the web server returns 404, while I need the router to process the URL, and dynamically create the page.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Gene Hagmt, 2019-06-16
@g_hagmt

In the end, I solved it like this:
.htaccess in the root of the site:

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ index.php [QSA,L]

and index.php itself handles url requests.

C
CityCat4, 2019-06-16
@CityCat4

Typically, the router checks the URL against a specific list of available addresses.

What? Was the grass good? The router has nothing to do with urls at all, it works much lower.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question