Emlog开启全站https还是很方便的,直接在后台把地址修改为https的然后更新缓存数据就全站https了。https各大搜索引擎目前都不会很友好的收录,所以我们必须用规则来让引擎访问我们网站的时候打开的是http页面,这也是目前唯一http网站不影响收录的解决方案。IIS那种403跳转就算了吧,严重影响收录。 直接上分享,你懂的。 443配置(注意把3个服务器根证书也改成自己的路径):- <VirtualHost *:443>
* v p' _* O0 Z9 j - DocumentRoot /data/www/web/web0001/) M9 Z- e; `" V1 p+ o
- ServerName localhost:443+ a5 S& i% f4 }
- SSLEngine on3 q3 v* v4 V/ v
- SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL* C+ F6 B9 E! t1 `; o
- SSLCertificateFile /data/limhme.crt
% x$ ~- R# V5 V; c- | N7 D - SSLCertificateKeyFile /data/limhme.key
8 K; L& T( ^; [1 N7 c# w - SSLCertificateChainFile /data/root_bundle.crt$ F6 z j; c! Z0 N, G A" F
- <FilesMatch "\.(cgi|shtml|phtml|php)$">0 L( f4 e6 l* U
- SSLOptions +StdEnvVars
+ i5 ?' k- l: y2 D# N4 { - </FilesMatch>
4 u4 v# m% ^" H! v y" o - <Directory /data/www/web/web0001/>
2 k! S0 J/ [2 g& D1 S - Order allow,deny
9 U; Z% @5 e$ V' q - Allow from all
; ]1 r9 H+ n' O9 i7 ~% j: w8 ^% t - Options Indexes FollowSymLinks; }; _4 D# K2 q
- AllowOverride All
" d4 {. p! v8 c; `2 g+ N2 V - </Directory>7 a9 P' [; g$ L1 k3 C
- BrowserMatch ".*MSIE.*" \
, k8 Z1 x$ i; i' }* n, M - nokeepalive ssl-unclean-shutdown \
8 ]" G. ]: H8 `2 R8 e- N! h- P- r& K - downgrade-1.0 force-response-1.0. D2 E5 ?" Q4 X! A
- ErrorLog logs/dummy-host.example.com-error_log( o! _& z0 H1 c/ o. o" ]) L
- CustomLog logs/dummy-host.example.com-access_log common
, D+ G+ d, U6 i' P* Y. `; F - </VirtualHost>
复制代码 80配置:- <VirtualHost *>+ D [- f/ O* C; x3 a# D
- DocumentRoot /data/www/web/web0001/
7 v/ [7 S) D; Y4 |4 H - ServerName web0001# o; ]2 E* @9 h% B0 V5 i
- ServerAlias tuyuanma.com
$ B5 a ]5 f/ M+ v" ` - ServerAlias www.tuyuanma.com
% ^6 _+ s4 y6 _! R3 L - <Directory /data/www/web/web0001/>8 O7 O' x h& f+ [9 y" `) `6 I
- AllowOverride FileInfo
" s: d; @3 C/ E# e4 i5 j0 C - </Directory>
* [3 z0 L6 [8 X! C7 z - </VirtualHost>
复制代码 Emlog伪静态规则包含 www.tuyuanma.com 重定向tuyuanma.com,http重定向https,搜索引擎自动http不影响收录的.htaccess规则:
6 a7 {: a6 Q# r4 ^: q& {, f- RewriteEngine on
% k+ I; X6 D* a9 U) F4 E - RewriteCond %{http_host} ^www.<span style="color: rgb(0, 0, 0);">tuyuanma.com</span> [NC]
( \; H k: I2 v3 G$ S8 o - RewriteRule ^(.*)$ https://<span style="color: rgb(0, 0, 0);">tuyuanma.com</span>/$1 [L,R=301]
" ^& Y# Q. A! y% T - RewriteCond %{SERVER_PORT} !^443$( C8 \ I4 o" s- T/ D& S2 a! l
- RewriteCond %{HTTP_USER_AGENT} !(baiduspider|soso|bing|sogou|yahoo|sohu-search|yodao|robozilla|msnbot|msie|feedburner) [NC]8 V ?9 O8 @ c) [- N* A
- RewriteRule (.*) https://<span style="color: rgb(0, 0, 0);">tuyuanma.com</span>/$1 [R=301,NC,L]6 S- M# O$ G4 ~4 @) X3 D
- RewriteCond %{REQUEST_FILENAME} !-f
. ?& M( i1 m- n5 ~5 m - RewriteCond %{REQUEST_FILENAME} !-d6 k9 j& ~) y' N
- RewriteBase /
6 z/ B- A: I" g) |6 u5 Z - RewriteRule ^(.*)$ /index.php/$1 [L]
复制代码 $ H. U8 K0 C S1 v
( Z3 u k7 t0 r9 F! h) y
|