I have a website http://www.example-domain.com and I want to rewrite the URL so that I can change this subdomain with the subdomain I want, like I want this URL to be called like http://abc.example-domain.com instead of http://www.example-domain.com and still get the same page being loaded as we are getting on http://www.example-domain.com, i dont want a new subdomain with name 'abc' instead i want my url to be rewritten in such a way that it looks like that it's a subdomain in it but actually it isn't and i need it to be done by using URL REWRITING using htaccess. plz elaborate a bit along with you solution. thx
Asked
Active
Viewed 49 times
-2
-
1Does this answer your question? [Rewrite subdomain to main domain without redirect with htaccess](https://stackoverflow.com/questions/33217233/rewrite-subdomain-to-main-domain-without-redirect-with-htaccess) – Mark Jun 17 '21 at 03:40
-
No, that post is changing the place of the subdomain and I don't want that, instead I just want to have an impact of the rewriting on the subdomain content and not the position of the subdomain. – Abdul Muhamin Rehman Jun 19 '21 at 05:39
2 Answers
1
This is not possible.
The browser will look up the IP address of the subdomain in the DNS (Domain Name System) find nothing and load an error page.

Marcel Burkhard
- 3,453
- 1
- 29
- 35
-
well I can change http://www.example-domain.com/index.php by rewriting url, isn't it possible for sudomain part as well ??? – Abdul Muhamin Rehman Jun 16 '21 at 11:51
-
If the subdomain points to your server too, maybe. But from your question I thought it doesn't. – Marcel Burkhard Jun 16 '21 at 11:54