apache - htaccess: Redirect ANY Request to a specific URL -


i can't seem set htaccess-file redirects kind of request www.mydomain.com. use following rule redirect:

rewriterule ^(.*)$ www.mydomain.com [r=301,l] 

the problem enter endless redirection loop because correct url redirected well. tried preventing using

rewritecond %{env:redirect_status} ^$ 

and

rewritecond %{http_host} !^www.mydomain.com [nc] 

as conditions, kind of variation of it, end flag. none of worked.

all need is

  • redirection specific url called ab.xy.com www.mydomain.com

  • redirection mydomain.com www.mydomain.com

what doing wrong, , how can achieve this? thank you!


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -