Score:0

deny direct access to folder but allow rewrite redirection

sy flag

I have a question about htaccess. I have a rather complex website structure on the server and I use htaccess for redirection.

the site structure is as follows

web/project/test_project/
├─ admin/
├─ catalog/
├─ index.php

In web/ folder I have .htaccess and and my question is how can i make admin folder accessible from url example.com/dashboard. I know it can be done with rewrite rule. But my second quest - is there any way to block direct access via example.com/web/project/test_project/admin?

I'm at the stage where I have rewrite rule access set up, but I don't know how to combine that with blocking direct access.

RewriteCond %{REQUEST_URI} dashboard
RewriteRule ^dashboard(/.*|$) /project/test_project/admin/$1 [L,QSA]

Thank you very much

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.