is there any way that sub-directory of a domain and its sub-domain work exactly the same way?

0

For example, I have a domain example.com. Then I have created a subdomain from it e.g same.example.com

I want that, same.example.com and example.com/same/ will work the same way. such as same.example.com/another/ and example.com/same/another will make the same result and so will do any other HTTP request and any further sub-directories.

Thank you.

Noman

Posted 2019-09-27T07:32:16.813

Reputation: 1

Answers

3

The easiest way to do this, and probably the one that will be easiest to maintain long-term, is to have your web server redirect one method to the other.

This is the approach that Google uses. For example, browsing to:

https://maps.google.com/

automatically redirects the user to:

https://www.google.com/maps/

bitinerant

Posted 2019-09-27T07:32:16.813

Reputation: 246

2

Assuming that your web root for example.com was a folder called ex. www\html, you could create a folder called ex. www\html\same and point same.example.com to it (i.e. make www\html\same the webroot for your subdomain). Then example.com\same and same.example.com would yield the same content.

With this method, if you added another folder e.g. www\html\same\another, then example.com\same\another and same.example.com\another would automatically (again) yield the same content.

Anaksunaman

Posted 2019-09-27T07:32:16.813

Reputation: 9 278