There is a self-written cms, the main index.php file, then it loads the iframe with the necessary projects (site), which are located in the folder

/project/[имя проекта]/[страничка.php] 

Control takes place via GET requests, the string looks like:

 domen.ru/?project=name&page=index.php 

C folder /project/ worth redirect to home. BUT in the source code you can see the frame link and open directly

 /project/[имя проекта]/[страничка.php] 

Task: I would like to make a “single entry point” (does not work) so that all requests along the /project/[что то там] path /project/[что то там] thrown to index.php and it was impossible to open projects directly.

If you simply register RewriteRule ^(.*)$ index.php [L,QSA] then in the frame itself there is also a redirection of content, which is not acceptable (

  • Very simple - move the project directory to a level above index.php - andreymal
  • and what will it give? mine that is higher that lower - no difference! - XStream
  • And what do you think will be links to files if the directory is a level higher than index.php?) - andreymal
  • maybe I did not understand you correctly, and maybe you did me. I would like to deny access to files directly. and from under the frame it would be possible to load. if we place the folder below, what will change? - XStream
  • Although yes, I seem to have misunderstood the question. If you want the page in the frame to open, but not to open without the frame, then it is technically impossible, because the frame is the same ordinary page - andreymal

1 answer 1

And what if you make the projects open only by token, which can only generate index.php. If there is no token - redirect.

  • Try to write more detailed answers. Explain what is the basis of your statement? - Nicolas Chabanovsky
  • @Kromster is more like a solution than a new question. - Nick Volynkin
  • @NickVolynkin missed, sorry - Kromster
  • @Kromster Yes, this is the solution. Actually, this is how I did a couple of years ago with a similar task. - iProger