Configure Virtualhost

0

I'm looking to configure my virtualhost and I'm assaulted by a problem.

I currently have a domain and a subdomain. The fact is that in the subdomain I want that when you put subdomain.domain.es/foo is redirected to / path / to / foo and when you put subdomain.domain.es/ bar is redirected to / path / to / bar while being on very different routes.

I currently have this:

# Jobs
<VirtualHost *:80>

ServerAdmin 
ServerName subdominio.dominio.net/jobs
DocumentRoot /path/to/lv-jobs/public

<Directory /path/to/lv-jobs/public>
    Require all granted
    Options -Indexes
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    Header set Access-Control-Allow-Origin "*"
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

# Portfolio
<VirtualHost *:80>

ServerAdmin 
ServerName subdominio.dominio.net/porfolio
DocumentRoot /path/to/test/public

<Directory /path/to/test/public>
    Require all granted
    Options -Indexes
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    Header set Access-Control-Allow-Origin "*"
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

But obviously I'm not doing it right. I'm also not interested in having jobs.domain.com for one and portfolio.domain.com for another.

If someone can help me, thank you very much

    
asked by Feagarnm 11.10.2018 в 12:26
source

0 answers