A
A
andruxin2013-11-25 10:34:26
Apache HTTP Server
andruxin, 2013-11-25 10:34:26

Is it possible to set .htaccess (site.ru) to redirect to a specific folder on the server?

There is a domain.ru domain in DNS referring to site.ru.
For site.ru, the parent folder is /mnt/data/apache/vhost2/site.ru
For sub.site.ru, the parent folder is /mnt/data/apache/vhost2/site.ru/sub.site
Is it possible to register in .htaccess (site .ru) redirect to a specific folder on the server /mnt/data/apache/vhost2/site.ru/sub.site/folder and to see the new domain.ru domain in the address bar?
Or does this trick need to be done through vhost.conf ?

<VirtualHost domain.ru:80>
DocumentRoot "/mnt/data/apache/vhost2/site.ru/sub.site"
ServerName domain.ru
ServerPath "/mnt/data/apache/vhost2/site.ru/sub.site"
</VirtualHost>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Eugene Mosyukov, 2013-11-25
@GeneMoss

in vhost.

M
Michael, 2013-11-25
@Mr4Mike4

Look here. It might help.
redirect

M
Michael, 2013-11-25
@Mr4Mike4

I did this myself:

<VirtualHost*:80>
  ServerName mydomen.org
  Redirect 302 / http://mydomen2.ru/
</VirtualHost>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question