Home>

The site created by Sirius, managed by the Sakura Internet rental server, suddenly became inaccessible after the evening of March 31, 2019 (Japan time). I was able to browse without problems until noon that day, and when I looked at the analytics in the evening, I noticed that the number of visitors was zero.

You can't view even if you try using IE or Chrome from a PC or iPhone. "This page is not working. Redirection has been repeated." Therefore, even if you try to delete the cookies by referring to the website where the measures are listed, it will not be improved.

On the Sakura Internet around October 2018 This site has been implemented for free SSL, and from that time until March 31, 2019, it was successfully redirected from http to https without problems, and the site could also be browsed. And since I haven't touched it at least this year and haven't made any special settings or changes, I don't know why the redirect loop occurred.

I have never touched .htaccess in Sirius or Sakura Internet and have never written anything.
By the way, here is the description of .htaccess that originally existed.

Description of .htaccess in Sakura Internet File Manager
<ifModule mod_headers.c>
Header set Vary User-Agent
</ifModule>
RewriteEngine Off
RewriteEngine On
RewriteBase /
SetEnvIf REDIRECT_HTTPS (. *) HTTPS = $1
<IfModule mod_rewrite.c>
RewriteCond% {HTTP_HOST} ^ (www \ .site URL \ .com) $[NC]
RewriteRule (. *) Https: // site URL.com% {REQUEST_URI} [R = 301, L]
RewriteCond% {ENV: HTTPS}! On
RewriteRule. * Https: //% {HTTP_HOST}% {REQUEST_URI} [R = 301, L]
</IfModule>
RewriteCond% {HTTP_USER_AGENT} (iPhone | iPod | Android. * Mobile | Windows. * Phone | BlackBerry)
RewriteRule ^ $iphone/redirect.php? F = index \ .html [L]
RewriteCond% {HTTP_USER_AGENT} (iPhone | iPod | Android. * Mobile | Windows. * Phone | BlackBerry)
RewriteRule ^ (. *) \. Html iphone/redirect.php? F = $1 \ .html [L]
RewriteCond% {HTTP_USER_AGENT} (iPhone | iPod | Android. * Mobile | Windows. * Phone | BlackBerry)
RewriteRule ^ (. *) \. Css iphone/$1.css [L]
RewriteCond% {HTTP_USER_AGENT} (iPhone | iPod | Android. * Mobile | Windows. * Phone | BlackBerry)
RewriteRule ^ img /(.*) iphone/img/$1 [L]
RewriteCond% {HTTP_USER_AGENT} (iPhone | iPod | Android. * Mobile | Windows. * Phone | BlackBerry)
RewriteRule ^ (. *)/Iphone/redirect.php? F = $1/index \ .html [L]
RewriteCond% {HTTP_USER_AGENT} (iPhone | iPod | Android. * Mobile | Windows. * Phone | BlackBerry)
RewriteRule ^ (. *) Iphone/$1 [L]
RewriteCond% {HTTP_USER_AGENT} ^ (DoCoMo | KDDI | UP \ .Browser | J-PHONE | Vodafone | SoftBank)
RewriteRule ^ $m/redirect.php? F = index \ .html [L]
RewriteCond% {HTTP_USER_AGENT} ^ (DoCoMo | KDDI | UP \ .Browser | J-PHONE | Vodafone | SoftBank)
RewriteRule ^ (. *) \. Html m/redirect.php? F = $1 \ .html [L]
RewriteCond% {HTTP_USER_AGENT} ^ (DoCoMo | KDDI | UP \ .Browser | J-PHONE | Vodafone | SoftBank)
RewriteRule ^ img /(.*) m/img/$1 [L]
RewriteCond% {HTTP_USER_AGENT} ^ (DoCoMo | KDDI | UP \ .Browser | J-PHONE | Vodafone | SoftBank)
RewriteRule ^ (. *)/M/redirect.php? F = $1/index \ .html [L]

Also, it can be viewed in the local environment. (You can check the site in Sirius preview)

I would like to let you know that I would like to get out of this situation and continue to browse the website without any problems. I would like to humbly thank you.

Error message

When you check the top page with Chrome's Redirect Path, it is redirected from the same URL starting with https to the same URL, https: // 00 → https: // 00 → ... I think that a loop has occurred.
Similar results were obtained for major pages other than the top page (probably all pages).

ERR_TOO_MANY_REDIRECTS

・ Delete cookies → ×
-Inquiries about the above contents to Sakura Internet by e-mail->"Since the automatic transfer settings of the page are not correct, I would like to review the description of .htaccess." *
・ Check Sirius settings (site URL is https) → No problem, not touching in the first place.
・ Upload Sirius backup data → ×
-Confirm that the URL in the canonical tag is also https.
・ this site and the following code on this site are written → ×

RewriteEngine On
RewriteCond% {REQUEST_URI}! ^/Robots.txt $
RewriteCond% {REQUEST_FILENAME}! 404error.html $
RewriteCond% {REQUEST_FILENAME} -f [OR]
RewriteCond% {REQUEST_FILENAME} -d
RewriteCond% {ENV: HTTPS}! ^ On $
RewriteCond% {HTTP: X-SAKURA-FORWARDED-FOR} ^ $
RewriteRule ^ (. *) $Https: //% {HTTP_HOST}% {REQUEST_URI} [R = 301, L]
SetEnvIf REDIRECT_HTTPS (. *) HTTPS = $1
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond% {ENV: HTTPS}! On
RewriteRule. * Https: //% {HTTP_HOST}% {REQUEST_URI} [R = 301, L]
</IfModule>


・ Enter the above code in .htaccees in Sakura Internet File Manager → ×

Addition: Status as of April 7, 2019

I've tried and errored by looking at the following site with reference to the advice, but I still can't get out of the redirect loop. https://engineer-milione.com/create/sakura-htaccess.html

What you did

Because we want to unify without using www using SSL, in addition to the domain "00.com" used by Sakura Server, we newly registered "www. I selected "Use as multi-domain without giving www (for advanced users)" and "Use SNI SSL" and set SSL certificate.

After that, the file manager was accessed, and the following code was added to the top of the existing .htaccess in "00.com" under/home/username/www.

SetEnvIf REDIRECT_HTTPS (. *) HTTPS = $1
 <IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond% {ENV: HTTPS}! On
 RewriteRule. * Https: //% {HTTP_HOST}% {REQUEST_URI} [R = 301, L]
 </IfModule>


I also created a new folder called "www.〇〇.com", placed it under/home/username/www, put the .htaccess file in it, and wrote the following code.

SetEnvIf REDIRECT_HTTPS (. *) HTTPS = $1
 <IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond% {HTTP_HOST} ^ www \ .〇〇 \ .com
 RewriteRule (. *) Https: // 〇〇/$1 [R = 301, L]
 </IfModule>


Under "/ home/username/www", there are two "xxx.com" and "www.〇〇.com". "〇.com" contains all information on the site, "www. 〇.com "contains only .htaccess.

Current state

I tried 4 patterns with https, http, and www, but all of them were first transferred to https://00.com, but then https: //00.com→https: // 〇〇.com → ・ ・ ・ will cause a redirect loop.

Is the code description, folder creation location, or something else wrong?
I am very busy, but I would appreciate it if you could tell me.

  • Answer # 1

    The server number is unknown, but according to the official announcement of Sakura FreeBSD update

      

    SetEnvIf REDIRECT_HTTPS (. *) HTTPS = $1
      <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteCond% {ENV: HTTPS}! On
      RewriteRule. * Https: //% {HTTP_HOST}% {REQUEST_URI} [R = 301, L]
      </IfModule>

    If

    is written, it will cause a problem on the updated server.

    See

    Changes due to FreeBSD update (updated 2/4/2019).

      

    (Added on February 12, 2019)
      【About .htaccess description】
      If there is a description of "SetEnvIf REDIRECT_HTTPS (. *) HTTPS = $1" in .htaccess installed in your server,
      There will be a problem that the page will not be displayed after the OS upgrade.
      Therefore, if this description is included in .htaccess, only the line with the description will be commented out during maintenance.
      Although it was a necessary description in the previous environment, it is now an unnecessary description, so it can be corrected by the customer in advance.

    , etc. It might be a problem described for redirecting.


    First, remove http->https redirect settings and see if the problem goes away.


    If you have confirmed that there is no longer a problem with the redirect loop and encryption (SSL) is enabled, you can redirect to the encrypted page using the HTTP->HTTPS redirect setting. Please try it.

  • Answer # 2

    Good evening, isn't it close to what is shown on this page?
    https://en.stackoverflow.com/questions/26736/How to detect https with Sakura server htaccess