我在其管理面板中使用 godaddy 作为主机我有 .htaccess 文件,如下所示
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /core.php [L]
</IfModule>
我进行了设置以将其强制为 https,如下所示
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%(HTTP-HOST)%{Request-URI} [L,R=301]
</IfModule>
谁能告诉我在哪里放置 core.php 规则。我的 core.php 给出如下
<?php
error_reporting( E_ALL );
require_once( "ccioo/Template/class.Page.php" );
header( "Content-Type: text/html; charset=utf-8" );
if ( function_exists( "date_default_timezone_set" ) ) {
date_default_timezone_set( "Asia/Taipei" );
}
$myPage = new Page();
$myPage->Output();
?>
更新:
所以我想要的是要么我输入 www.myfavouriteweb.com 要么https://www.myfavouriteweb.com它应该重定向到https://www.myfavouriteweb.com