This is confusing me how to redirect all subdomains that I have not setup on the server to another url.I fund this article but hell if I can get it to work. https://www.namecheap.com/support/knowl ... in-cpanel/
What am I doing wrong.
Cpanel in domains I have created *.mydomain.com and it shows as /public_html/wildcard
In zone editor I can not find *.mydomain
When I create the A record for *.mydomain in zone editor and save it still does not show up.
how to redirect all typo subdomains
-
Slim
- Verified Member

- Posts: 435
- Joined: September 26th, 2018, 3:02 am
how to redirect all typo subdomains
Some people can be Dumb and Dumber
- TheButcher
- Administrator

- Posts: 17531
- Joined: February 2nd, 2018, 11:48 am
- Title: I like weekends
- Referrals: 1
- Contact:
The way I do it (might not be the best way) but it works for the longest time is I created a "*wildcard" subdomain and in that directory I added a .htaccess file with the one line of code
you can test it here type any subdomain on sponsorchat.com it should redirect to that url
For example, slim.sponsorchat.com
Peace
Code: Select all
RewriteEngine on
RewriteRule (.*) https://www.sponsorchat.com/index2.html/$1 [R=301,L]you can test it here type any subdomain on sponsorchat.com it should redirect to that url
For example, slim.sponsorchat.com
Peace
-
Slim
- Verified Member

- Posts: 435
- Joined: September 26th, 2018, 3:02 am
It worked thanks for the code butcherTheButcher wrote: ↑February 6th, 2023, 8:20 amThe way I do it (might not be the best way) but it works for the longest time is I created a "*wildcard" subdomain and in that directory I added a .htaccess file with the one line of code
Code: Select all
RewriteEngine on RewriteRule (.*) https://www.sponsorchat.com/index2.html/$1 [R=301,L]
you can test it here type any subdomain on sponsorchat.com it should redirect to that url
For example, slim.sponsorchat.com
Peace
Some people can be Dumb and Dumber