E
E
eugene1592020-08-07 21:47:08
Apache HTTP Server
eugene159, 2020-08-07 21:47:08

How to make a site from a specific folder on the site open when entering a subdomain? But at the same time, so that when I enter the url of the folder, 404 is displayed?

I have a portfolio site. And I want to place my large pet projects on subdomains.

I created a subdomains folder in the root of the site. And I put my projects there. For example, the project site_1.

How can I make it so that a specific site opens when entering a subdomain, for example, when entering site_1.my-site.rua site from the folder my-site.ru/subdomains/site_1? But at the same time, so that when I enter the url my-site.ru/subdomains/site_1, I get a 404? I don't want projects to be able to be opened from a folder directly.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2020-08-07
@402d

do not use autosubdomain features.
Understand where the site is located physically and its FQDN is not rigidly linked.
ServerName domain or subdomain you need
DocumentRoot "path to files"
These are just two parameters in the virtual host description.
In general, how to set it up correctly and whether it is possible depends on your hosting tariff. If you have taken yourself vpska, then generally do what you want.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question