apache - multiple conditions in .htaccess redirect with both if and or -


im trying setup htaccess redirect "domain.com" "www.domain.com" if request not "t.domain.com"

below takes care of first part:

    rewritecond %{http_host} !^$     rewritecond %{http_host} !^www\. [nc]     rewritecond %{https}s ^on(s)|     rewriterule ^ http%1://www.%{http_host}%{request_uri} [r=301,l] 

but how extend not redirect if request "t.domain.com"?

thanks!

you can use:

rewritecond %{http_host} !^(www|t)\. [nc] rewritecond %{https}s ^on(s)| rewriterule ^ http%1://www.%{http_host}%{request_uri} [r=301,l] 

Comments

Popular posts from this blog

c++11 - Intel compiler and "cannot have an in-class initializer" when using constexpr -

rest - Spring boot: Request method 'PUT' not supported -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -