Redirect Loop Detected with CertSage

I created a file called test.php
http://drstevensukinurology.com/.well-known/acme-challenge/test.php

and the links works.. so what am I missing?

1 Like

How about a static text file rather than a PHP script?

4 Likes

the test.php is just a files with the word test in it but I can make a txt file too.
http://drstevensukinurology.com/.well-known/acme-challenge/test.txt

1 Like

Where did you put certsage.php?

1 Like

Yes, it's an issue. Browsers remember 301s. You should use a 302 there. (or 307) -- don't remember what they are used for).

And... you should not issue a 3xx (redirect) code on a 4xx (client error) page at all.

If you want that behavior, issue a 404, and then redirect using a meta tag.

2 Likes

I did not put it anywhere...
As I mentioned when I started, i am new and just trying to start using this but kept running into odd errors at the beginning.
Where do I get that file and where should i put it?

This is all great information. Can you direct me to where I can learn how to implement this?
Adding a redirect in the meta tag.. of the 404.php or somewhere else?

I'd say yes but I don't know how your theme works.

1 Like

I changed the code to this in the 404.php:

<?php header("HTTP/1.1 302"); header("Location: ".get_bloginfo('url')); exit(); ?>

I am using Avada. I will search for meta tag redirect as well.

That 302 isn't doing anything, you know. I just get the proper 404.

Note that there are accessibility concerns. I usually don't redirect 404s.

2 Likes

you have to include the root in your url :wink:

not
<meta http-equiv="refresh" content="0; URL=drstevensukinurology.com/">
but
<meta http-equiv="refresh" content="0; URL=//drstevensukinurology.com/">
which is equivalent to both
<meta http-equiv="refresh" content="0; URL=https://drstevensukinurology.com/"> and
<meta http-equiv="refresh" content="0; URL=http://drstevensukinurology.com/">

2 Likes

I know this may be dumb.. but am I suppose to put certsage.php some where in the site directory?
How do

The current code is just redirects to the home page... i did find this code:

But the 404.php doesnt have a true header so the code just sort of looped it self until it crashed i think.
Will this help get a cert on the site?

OK i will try it again

It should've worked even before. That theme isn't handling 404 the proper way.

I'm not a CertSage expert but I think CertSage.php should go side by side with the main index.php

2 Likes

Its not as fast the php code but it does seem to be working now.
thank you

What do I do now to get the cert on the site?

Now you can follow the instructions for CertSage.

2 Likes

OK. I will do this now.
Thank you so much!

2 Likes

OK. so I ran the certsage. for the domain and www. It had success. Created a folder with the info in it.
I followed the instructions... but when I paste the cert in the spot in the cpanel it says "The certificate is not valid."

and wont let me save it.
What can I do now :slight_smile: @griffin

1 Like

Did you have staging or production selected?

3 Likes

Production.

1 Like