How to redirect a request to a specific folder?

0

I'm using Apache 2. I'm currently developing a website and would like to show a preview to my client. To not have to mess with DNS now, I need a way to map the URLs of the sites to specific folders.

For example. I am developing a website for John. The installation of Wordpress is in /var/www/sites/joao . When the url http://meudominio.com.br/joao is accessed, I want the request to be sent to /var/www/sites/joao .

Does anyone have an idea how I could do this?

    
asked by anonymous 22.08.2016 / 19:23

1 answer

0

If this is what I understand, you can create the folder joao within mydomain.com getting yourdomain.com/joao and within that folder create an .htaccess file with the following content:

RewriteEngine On
RewriteRule ^(.*)$ /sites/joao/$1 [L]

This will map the / joao directory to / sites / joao

More about htaccess you can find in this topic link

    
29.08.2016 / 15:22