0

I need to point web url's like

http://example.com/subdir1
http://example.com/subdir2

to same directory

/var/www/vhosts/example.com/httpdocs/default/

on Linux hosting (Ubuntu 16.04, Apache2) - how to do that, please?

Cyclonecode
  • 29,115
  • 11
  • 72
  • 93
  • You may want to provide details of which web server you are using – Vampiro Dec 16 '17 at 17:59
  • I'm using Ubuntu 16.04 on VPS and Apache2 –  Dec 16 '17 at 18:05
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Dec 16 '17 at 20:26
  • Thank you, will ask there, but maybe it can be solved using .httaccess rewrite rules so I hoping that someone will post some idea. –  Dec 16 '17 at 20:39
  • This can be done by setting the `DocumentRoot` for both virtual host in a configuration file located under `/etc/apache2/sites-available` and then enable the configuration by executing `a2ensite `. Read up on how to configure a virtual host for apache2. Here is a link that shows a basic setup: https://stackoverflow.com/a/26490642/1047662 – Cyclonecode Dec 17 '17 at 03:23
  • Yes it works using Alias /subdir1 "/var/www/vhosts/example.com/httpdocs/default" but I can not access vhost.conf each time so the question is - how to write that using .htaccess, please? –  Dec 17 '17 at 10:28

0 Answers0