1

我遇到了以下问题:我设置了 cronjob 每 5 分钟执行一次我在 public_html 文件夹中的 php 脚本,每次它尝试执行它时,我都会收到下一件事(错误 r 在我的邮件中发送):

Status: 302 Moved Temporarily
Set-Cookie: ava=sdasdasf1wfsadads; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location:http://localhost/myhostname.com/web/
Content-type: text/html; charset=UTF-8

我将以下 cmd 用于 cron 作业:php /home/xxxx/public_html/_fnewsletter.php

另外,我想使用 htaccess 将每个用户重定向到页面的 https:// 版本,并使用 htaccess 正确使用 upgrade-insecure-requests

这是我的 htaccess 文件:

   #Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

#RewriteCond %{REMOTE_ADDR} !^xxx\.xx\.xx\.xxx #ignore the xxx-s , its just an IP
#RewriteCond %{REQUEST_URI} !^/splash\.html$
#RewriteRule ^(.*)$ /splash.html [R=307,L]


  # we skip all files with .something
  #RewriteCond %{REQUEST_URI} \..+$
  #RewriteCond %{REQUEST_URI} !\.html$
  #RewriteRule .* - [L]

  RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
  RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]  



  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
4

0 回答 0