N
N
nepster-web2014-03-03 19:53:09
Apache HTTP Server
nepster-web, 2014-03-03 19:53:09

How to specify a different DocumentRoot for Apache to a specific url?

I have a virtual host of my local server (on openserver)

<VirtualHost 127.0.0.1:80>
DocumentRoot "F:/OpenServer/domains/portf.ru/yii2-app-advanced/frontend/web"
ServerName "portf.ru"
ServerAlias "portf.ru"
<IfModule alias_module>
ScriptAlias /cgi-bin/ "F:/OpenServer/domains/portf.ru/cgi-bin/"
</IfModule>
<Location /openserver/server-status>
SetHandler server-status
</Location>
</VirtualHost>

We start portf.ru and get into F:/OpenServer/domains/portf.ru/yii2-app-advanced/frontend/web , everything is fine.
Now I want to get to F:/OpenServer/domains/portf.ru/yii2-app-advanced/backend/web when requesting portf.ru/admin

<Location /admin>
DocumentRoot "F:/OpenServer/domains/portf.ru/yii2-app-advanced/backend/web"
</Location>

But the Apache does not rise, please tell me what to do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
victimofbrainlessness, 2014-03-03
@victimofbrainlessness

doesn't rise because there can't be 2 docuemtroot
use Alias
​​httpd.apache.org/docs/2.2/urlmapping.html
if yii requires documentroot
create subdomain and separate virtualhost

P
phpnt, 2015-03-06
@phpnt

Installing Yii2 Framework on Windows.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question