# Redirect Coding Help

**URL:** <https://forums.realmacsoftware.com/t/redirect-coding-help/43207>\
**Category:** RapidWeaver Classic\
**Created:** [May 5, 2024, 1:13pm UTC](https://forums.realmacsoftware.com/t/redirect-coding-help/43207 "2024-05-05T13:13:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pearson4](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@pearson4](https://forums.realmacsoftware.com/u/pearson4)\
**Post date:** [May 5, 2024, 1:13pm UTC](https://forums.realmacsoftware.com/t/redirect-coding-help/43207/1 "2024-05-05T13:13:35Z")

</div>

Need some guidance with CODE:

Google (the evil one) search console reports 48 redirect errors on my site. The pages consist of [http://customdrains.com/+path](http://customdrains.com/+path) to pages or [https://www.customdrains.com/+path](https://www.customdrains.com/+path) to pages

As far as I know the “Domain” resolves to the https://

Here is what I have in the .htacess file currently (which is way above my technical pay grade):

RewriteEngine on RewriteCond %{HTTP\_HOST} ^www\.customdrains\.com [NC] RewriteRule ^(.\*)$ http://customdrains.com/$1 [L,R=301]

RewriteEngine On  
RewriteCond %{HTTPS} off [OR]  
RewriteCond %{HTTP:X-Forwarded-Proto} !https  
RewriteRule ^(.\*)$ [https://customdrains.com/$1](https://customdrains.com/$1) [R=301,L]

DirectoryIndex index.php index.html  
ErrorDocument 404 /404/

I’d like to get all the pages to redirect to corresponding page in the https:// mode to make these errors go away.

Thanx in advance for your help, I truly appreciate it.

Pearson

 ![redirect](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/6/6/66b8b8651b030001a377aaef2a2e251e2769d3b0.png)  
 ![redirect-1](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/e/e/eed388963b577559c6beacec0aa9d30e7772798b.png)

---

<div class="post-metadata">

**Author:** ![differentdan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/differentdan/32/33530_2.png) [@differentdan](https://forums.realmacsoftware.com/u/differentdan)\
**Post date:** [May 6, 2024, 12:34pm UTC](https://forums.realmacsoftware.com/t/redirect-coding-help/43207/2 "2024-05-06T12:34:54Z")

</div>

Hey @pearson4,

Try removing:

```auto
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^www\.customdrains\.com [NC] 
RewriteRule ^(.*)$ http://customdrains.com/$1 [L,R=301]

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://customdrains.com/$1 [R=301,L]

```

And replacing it with:

```auto
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.customdrains\.com [NC]
RewriteRule ^(.*)$ https://customdrains.com/$1 [L,R=301]

```

Let us know if you get any errors after doing that.
