Nate
Nate

Reputation: 28464

Should a subdomain be accessible as subfolder?

I have a subdomain for my website created in cPanel and I've noticed that in addition to being able to access the content through this URL:

subdomain.example.com

It can also be accessed via:

example.com/subdomain

Questions:

  1. Is that normal?
  2. Is there any way to only allow access to the subdomain through, well, the subdomain?

Upvotes: 3

Views: 1319

Answers (1)

undecim
undecim

Reputation: 121

There's nothing wrong with it as long as either you don't send users to the directory, or the applications and pages in that directory can handle using two different URLs (e.g. it uses only relative URLs).

If you want to block the directory, then try this htaccess directive: RewriteRule ^subdomain/ - [L,R=404]

Upvotes: 4

Related Questions