.htaccess 使用https的Codeigniter重定向问题

.htaccess 使用https的Codeigniter重定向问题,.htaccess,codeigniter,redirect,ssl,mpdf,.htaccess,Codeigniter,Redirect,Ssl,Mpdf,我正在向我的项目中添加一个pdf函数,但在函数完成后重定向该函数时遇到了一个奇怪的问题 最初,它在本地主机和不使用ssl证书的测试主机上运行良好,但在与ssl证书关联的域上不起作用。我不知道原因,也没有调试信息可以指导我何时启动 没有ssl的工作代码: 你必须预订酒店才能让链接与你一起工作,否则它会将你重定向到主页 此url上的相同功能和repo: 我查找了有关ssl重定向的大多数线程,并更新了 .htaccess访问以下内容: RewriteEngine on # Enforce SSL h

我正在向我的项目中添加一个pdf函数,但在函数完成后重定向该函数时遇到了一个奇怪的问题

最初,它在本地主机和不使用ssl证书的测试主机上运行良好,但在与ssl证书关联的域上不起作用。我不知道原因,也没有调试信息可以指导我何时启动

没有ssl的工作代码: 你必须预订酒店才能让链接与你一起工作,否则它会将你重定向到主页

此url上的相同功能和repo:

我查找了有关ssl重定向的大多数线程,并更新了 .htaccess访问以下内容:

RewriteEngine on

# Enforce SSL https://www. 
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
###
# Removes access to the system folder by users.
# Additionally this will allow you to create a System.php controller,
# previously this would not have been possible.
# 'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#####RewriteRule ^(.*)$ /ndmilestone/index.php/$1 [L]
RewriteRule ^(.*)$ /ndmilestone/index.php?/$1 [L,QSA]
我正在使用mpdf库生成pdf文件,这是发票作为pdf函数:

function invoice_as_pdf(){
$assumptiondata=Array();

$filename="invoice".time().rand(1,9);
// As PDF creation takes a bit of memory, we're saving the created file in 
// /downloads/reports/

$sub_folder="downloads/reports/$filename.pdf";
$pdfFilePath = FCPATH."/".$sub_folder;
$finalurl=base_url().$sub_folder;

// pass data to the view
if (file_exists($pdfFilePath) == FALSE){

ini_set('memory_limit','32M'); // boost the memory limit if it's low ;)
$this->theme->view('Admin/modules/global/invoice', $this->data, $this);
$html = $this->load->view('Admin/modules/global/idev_invoice_print', $data, true); // render the view into HTML

$this->load->library('pdf');

$mpdf = $this->pdf->load();

$mpdf=new mPDF('utf-8'); 
// $pdf->useAdobeCJK = true;
$mpdf->charset_in='UTF-8';
// Add a footer for good measure ;)
$mpdf->SetFooter($_SERVER['HTTP_HOST'].'|{PAGENO}|'.date(DATE_RFC822)); 


$mpdf->SetDirectionality('rtl');
$mpdf=new mPDF('ar','A4','','',32,25,27,25,16,13); 
$mpdf->SetDirectionality('rtl');
$mpdf->mirrorMargins = true;

$mpdf->WriteHTML($html); // write the HTML into the PDF

$mpdf->Output($pdfFilePath, 'F'); // save to file because we can

}

$this->load->helper('url');  // it is auto-loaded but I'm testing to call here also 

redirect($finalurl); //redirect to the new PDF 

}
pdf文件也成功生成,事实上我尝试了几种方案,但直到现在我还不知道原因。 提前谢谢