A
A
Art. Ku.2015-02-03 00:15:31
PHP
Art. Ku., 2015-02-03 00:15:31

When visiting a non-existent domain page, it is created. How?

Here, for example, we go to www.aaaa.ru/xxxx/xxx/xxx , which does not exist, but instead of a 404 error, we see the "create" button, after clicking on which this page is created with a certain code. Or to immediately created. Where to steer, where to start? Thank you brothers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladlen Grachev, 2015-02-03
@gwer

The data is a little lacking. Pure PHP there or framework/CMS with you.
In general, you can do something like the following. From all pages, redirect to the main handler something like this:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

And the handler in index.php analyzes the address requested by the user and, based on it, already issues this or that information. Say, if there is data in the database at the current address, they are displayed. If not, it is proposed to create them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question