Multiple alias domains pointing to the same cPanel account are sharing the same .htaccess file. I need a domain-specific rule that redirects all traffic from aliasdomain.com to https://www.domain1.com only if:
HTTP_HOSTis currentlyaliasdomain.com(with or without WWW and http/https)exclude folder
/medias/- it must still be accessible fromaliasdomain.comexclude all
*.jpg,*.jpeg,*.pngand*.giffiles (even if the files are in root ofaliasdomain.com)always redirect to
https://www.domain1.comroot, no wildcard redirect and no redirect to non-ssl httpdomain1.comneeds to be excluded so if the same.htaccessfile is ondomain1.comit won't interfere.
I tried to adapt various code snippets found on StackOverflow but failed horribly getting it to work :( I asked a question there but mods told me to ask on ServerFault instead so here i am... Help would be really appreciated!