Apache htaccess设置和共享ssl证书
我的共享主机提供如下共享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
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>