.htaccess - htaccess redirect issue while redirecting subfolder to sub domain -


i need redirect subfolder subdomain using htaccess

i need redirect

example.com/test,

to https://user.example.com/test

i have below rule

     rewriteengine on      rewritecond %{http_host} ^(?:www\.)?example\.com$ [nc]     rewriterule ^test/?$ https://user.example.com/test [r=301,l] 

how modify rule satisfy above condition?

you can use:

rewriteengine on  rewritecond %{https} off [or] rewritecond %{http_host} !^user\.example\.com$ [nc] rewriterule ^test/?$ https://user.example.com/test [r=301,l,nc,ne] 

test in new browser avoid old cache.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -