.htaccess with addondomain and https ssl

Posted by admon on Server Fault See other posts from Server Fault or by admon
Published on 2013-07-03T15:57:20Z Indexed on 2013/07/03 17:07 UTC
Read the original article Hit count: 193

Filed under:
|
|
|

I have main domain and addon domain.

Question.

1)When surfing to: ftp.addondomain.com or mail.addondomain.com

For some reason it goes to the main domain. (normally this should not be problem but i still want completely separation) Do you know the syntax to redirect in the .htaccess file this: (.*).addondomain.com -> addondomain.com and where do i put the code? in the addondomain .htaccess or in the main domain attaccess

I.E any_words.addondomain.com should be forwarded to the addondomain.com so these: dsdhf.addondomain.com ftp.addondomain.com mail.addondomain.com ... all will be forwarded to: addondomain.com (i.e without the prefix).

2)Same question for https:// Main domain has SSL addon domain does not have ssl.

For some reason when surfing to: https:// addondomain.com you get to: http:// maindomain.com (the address bar shows https:// addondomain.com but the site pages - the page you see is the page of the main domain)

I would like that if user surfs to https:// addondomain.com then (since there is no ssl for the addon domain) then user will get to: http:// addondomain.com Or alternatively user will get error message. I do not want him to be redirected to the main domain.

Please if you can, write me what to add to the .htaccess and i will add it. Please also let me know where to write the code. I.E in the addondomain .htaccess or in the main domain attaccess Thanks.

© Server Fault or respective owner

Related posts about ssl

Related posts about .htaccess