Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache htaccess设置和共享ssl证书_Apache_.htaccess_Cakephp_Ssl - Fatal编程技术网

Apache htaccess设置和共享ssl证书

Apache htaccess设置和共享ssl证书,apache,.htaccess,cakephp,ssl,Apache,.htaccess,Cakephp,Ssl,我的共享主机提供如下共享SSl证书: https://host###.HostMonster.com/~username 其中host####是我在那里的帐户的托管服务器 我在public\u html的根目录下使用CakePHP应用程序,其中我有public\u html/webroot路径,我在public\u html上使用以下.htaccess设置: # Turn off the ETags Header unset ETag FileETag None # Turn off the

我的共享主机提供如下共享SSl证书:

https://host###.HostMonster.com/~username
其中host####是我在那里的帐户的托管服务器

我在
public\u html
的根目录下使用CakePHP应用程序,其中我有
public\u html/webroot
路径,我在
public\u html
上使用以下
.htaccess
设置:

# Turn off the ETags
Header unset ETag
FileETag None

# Turn off the Last Modified header except for html docs
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|mp3)$">
Header unset Last-Modified
</FilesMatch>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|mp3)$">
Header set Expires "Thu, 15 Jan 2015 20:00:00 GMT"
</FilesMatch>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|mp3)$">
   Header set Cache-Control "max-age=31449600"
 </FilesMatch>

# Use PHP5.3 as default
AddHandler application/x-httpd-php54 .php

Redirect /Hosting/Q/ http://sub.mydomain.net/

<IfModule mod_rewrite.c>
    RewriteEngine on
   #RewriteCond %{HTTPS} =on
   #RewriteBase /~twoindex/
   RewriteRule    ^$    webroot/    [L]
   RewriteRule    (.*) webroot/$1    [L]
</IfModule>
AddType audio/mpeg mp3
AddType text/xml xml

你能通过不安全的HTTP访问你的应用程序吗?@Choma是的,我能。通过
http://example.com
<IfModule mod_rewrite.c>
    RewriteEngine on
RewriteCond %{HTTP_HOST} ^host15\.HostMonster\.com [NC]
RewriteRule ^(.*)$ /~myuser/$1 [R,L]

   RewriteRule    ^$    webroot/    [L]
   RewriteRule    (.*) webroot/$1    [L]
  </IfModule>