Answer the question
In order to leave comments, you need to log in
How to read uri (or url) and display it on the screen?
Suppose there is a site test.st. It is necessary to make it so that when you go to test.st/% some phrase%, a page with the inscription "% some phrase%" is displayed.
Even if it is a phrase in English, without spaces.
As a possible solution, I see the issuance of some index.php on any request by nginx
, which would read uri (url) and display it using echo
But how to implement it - I have no idea
, the browser offers to download the contents of index.php (for example, when you go to test.st/lalala, it offers to download the lalala file, which, when opened with a text manager, shows the index.php code)
Answer the question
In order to leave comments, you need to log in
is it possible without php
something like this
location ~ /(.*) {
add_header Content-Type text/html;
return 200 $1;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question