Score:0

How to server index.php from different directory through .htaccess?

us flag

I am working on a project which is in Yii2. I have to integrate swagger UI for API documentation. My current directory structure:

current directory structure

This is what the .htaccess looks like:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
<IfModule mod_headers.c>
   Header set Access-Control-Allow-Origin "*"
</IfModule>

When I hit http://xxxx-api.local/swagger/index.php it treats it as a legit API and because there is no such controller and action it returns 404.

My question is do we have a way to render index.php from another swagger directory if the user hits this http://xxxx-api.local/swagger/index.php URL in the browser?

kz flag
What is the document root directory?
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.