Subdomain redirect

ndutoit

Member
I have a website and I want to make a htaccess redirect that will redirect
any-subdomain.mydomain go to mydomain

Is there a way to do this in htaccess.

(I tried *.mydomain in htaccess... Had to reload my hosting account:mad:)
 
Last edited:
Not sure why you want to redirect subdomains, especially if they don't exist. This is a 301 and this site can generate it. http://www.htaccessredirect.net/ But you have to have an existing subdomain. In your hosting account you can use cPanel to create redirects as well. Don't know why you had to reload the hosting account. Using a FTP client such as WinSCP all you had to do was reverse what you entered in .htaccess.

.htaccess has a lot of features that can be used so maybe there is a wild card for non existent subdomains, not sure. You may want to check this website out. www.webhostingtalk.com
 
Not sure why you want to redirect subdomains, especially if they don't exist. This is a 301 and this site can generate it. http://www.htaccessredirect.net/ But you have to have an existing subdomain. In your hosting account you can use cPanel to create redirects as well. Don't know why you had to reload the hosting account. Using a FTP client such as WinSCP all you had to do was reverse what you entered in .htaccess.

.htaccess has a lot of features that can be used so maybe there is a wild card for non existent subdomains, not sure. You may want to check this website out. www.webhostingtalk.com

I saw it used on a few sets like WordPress, and blogger. Just want to know how it's done.
Also, is there a way I can use htaccess or make a cname record to redirect mail.ndtsite.tk to webmail.webhost.com/mail1

I know a lot of html, css, and JavaScript, but I don't know much about the htaccess file.

No I couldn't even use ftp. My site went down completely. Only wa to fix was to reload.
 
What records and files do I need? using * doesnt work with my current webhosts.

I know a bit about tech, but when it comes to this, I don't know anything.
 
Back
Top