0

I want to rewrite all Subdomains to main Domain with .htaccess. I found this Redirect any sub domain to a page on main domain, but does not work.

Not Found
The requested URL / was not found on this server.

I tried other ways also, but when I type some random subdomain sub.domain.com, then I see always this error.

Then I watched this Video https://www.youtube.com/watch?v=SoVcEqnqqbI and he makes same thing, what I need, but he has Wildacard Subdomains. I have not with my hosting Package Wildcard Subdomains. This is Apache Server with PHP 7.0.

Is there any way to do this without WIldarcards?

P.S. I need to rewrite and not Redirect. If User types sub.domain.com must stay on it, but see content same as on domain.com

Community
  • 1
  • 1
SVANSKI
  • 426
  • 3
  • 13

1 Answers1

0

DNS only matters in so far as your subdomains must point somewhere that can redirect them; .htaccess can't replace that. If you want to be able to type any subdomain, and go to the one place, you need wildcard DNS.

Hopefully you don't mean exactly the same content for every subdomain, that's not good for SEO.

Walf
  • 8,535
  • 2
  • 44
  • 59