Answer the question
In order to leave comments, you need to log in
How to display a page that is not on FTP?
Hello. Actually, the topic is in the question. For better understanding, I will give an example:
When an article is created in any CMS, for example, at /about, then no corresponding page is created at this address. But at the same time, a fully capable page is displayed at this address based on a specific template and information taken from somewhere.
What exactly I need (including more or less general information on the question asked): how to implement a redirect / replacement of the "page" at /register to the page /index.php?action=register, so that the URL does not change, but the entire template is taken from the corresponding index?
Answer the question
In order to leave comments, you need to log in
Relatively speaking, all information about the page is taken from the database.
There is a php script that extracts information from the database and inserts it into the right places in the template.
In order for another page to open at /index.php?action=register, you need to organize the processing of GET parameters in the index.php script, and when the action variable is set to "register", the page is replaced by /register.
If you own php, then there should be no problems with writing code.
Full code that cut the toaster:
if ($_SERVER['QUERY_STRING']) {
header('HTTP/1.0 404 Not Found');
echo ('
<script type="text/javascript">
location.replace("/404.html");
</script>
');
exit();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question