.htaccess - httaccess redirects but issue with https -


i need redirect

https://www.example.com/test

to

https://user.example.com/test

i did using

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

now issue is, if load user.example.com/test or http://user.example.com/test

i user.example.com/test need https://user.example.com/test

how modify or add rule so?

you need check https in rule.

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

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -