# Redirect to www with .htaccess

**URL:** <https://community.localwp.com/t/redirect-to-www-with-htaccess/22651>\
**Category:** Support\
**Created:** [October 27, 2020, 10:45am UTC](https://community.localwp.com/t/redirect-to-www-with-htaccess/22651 "2020-10-27T10:45:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franz333](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/franz333/32/11717_2.png) [@Franz333](https://community.localwp.com/u/Franz333)\
**Post date:** [October 27, 2020, 10:45am UTC](https://community.localwp.com/t/redirect-to-www-with-htaccess/22651/1 "2020-10-27T10:45:43Z")

</div>

Hello guys,  
I am trying to test the redirection to www with .htaccess settings:

# Redirect to www

RewriteEngine On  
RewriteCond %{HTTP\_HOST} ^mysite.local [NC]  
RewriteRule ^(.\*)$ [https://www.mysite.loca/$1](https://www.mysite.loca/%241) [L,R=301]

But this won’t work. The redirection is trying to do its work but I get a “too many redirect” message from the browser.

Local version: 5.9.0+4961  
Server: Apache  
PHP: 7.3.5  
MySql: 8.0.16  
Wp version: 5.5.1  
OS: Windows 10 Family edition

I must precise that I already have a redirect to https rule settings in the .htaccess that is working fine.

Anyone has ever encountered this problem?

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [January 25, 2021, 10:45am UTC](https://community.localwp.com/t/redirect-to-www-with-htaccess/22651/2 "2021-01-25T10:45:46Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
