Emlog开启全站https还是很方便的,直接在后台把地址修改为https的然后更新缓存数据就全站https了。https各大搜索引擎目前都不会很友好的收录,所以我们必须用规则来让引擎访问我们网站的时候打开的是http页面,这也是目前唯一http网站不影响收录的解决方案。IIS那种403跳转就算了吧,严重影响收录。 直接上分享,你懂的。 443配置(注意把3个服务器根证书也改成自己的路径):- <VirtualHost *:443>
/ z) ?( J6 r; l$ R( n, O - DocumentRoot /data/www/web/web0001/
) X1 y- L; W3 R1 ^- K6 @0 r1 c - ServerName localhost:443
. e) n2 L: ?. m1 Z" V - SSLEngine on
( [! L$ t6 m) k: c - SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
1 l# m+ X6 t' H) P. q# U* | - SSLCertificateFile /data/limhme.crt: i( n( n" E, N9 l. R, h2 n
- SSLCertificateKeyFile /data/limhme.key
H& G- ^9 @$ J* z - SSLCertificateChainFile /data/root_bundle.crt
0 _- I- x) l, F - <FilesMatch "\.(cgi|shtml|phtml|php)$">
; ~9 T- E& J9 J9 L7 x8 W9 V - SSLOptions +StdEnvVars8 U8 K: z5 k x2 S2 H: D
- </FilesMatch>3 E: Q8 l4 w t2 e: ?2 } Y* b
- <Directory /data/www/web/web0001/>
2 ?9 j4 ?# f5 P* s5 s - Order allow,deny3 o" T+ t1 |0 N: \$ h! n$ X
- Allow from all+ ^+ L( _" l7 M1 R/ f7 x- T
- Options Indexes FollowSymLinks
. g3 X- R! ~4 H# R - AllowOverride All8 B+ r- q- f$ r: V; M
- </Directory>
9 N$ p- {- W* y* b3 }8 h4 s - BrowserMatch ".*MSIE.*" \( X+ }6 _0 ^# _
- nokeepalive ssl-unclean-shutdown \7 f# W0 k" z2 Z o* Y
- downgrade-1.0 force-response-1.0
/ I% H! d3 h5 G* H% p - ErrorLog logs/dummy-host.example.com-error_log
7 ^( W1 s) b6 g; v; e; M - CustomLog logs/dummy-host.example.com-access_log common
( C& {4 q7 ~: s - </VirtualHost>
复制代码 80配置:- <VirtualHost *>$ b5 P- U2 n; b$ N2 b$ }9 i6 h
- DocumentRoot /data/www/web/web0001/1 q h) g/ V& X
- ServerName web00014 f: n3 v+ h9 S3 g/ i
- ServerAlias tuyuanma.com
. P2 C" I0 j, j; @/ a# _) X - ServerAlias tuyuanma.com
+ F, U' R# X* v - <Directory /data/www/web/web0001/>
9 @5 l1 }0 g; q. e* W- m+ s7 `) f, u - AllowOverride FileInfo
* A7 j7 a; I) m& O - </Directory> `8 J" A3 e+ H, `0 P' G1 r8 }& { S
- </VirtualHost>
复制代码 Emlog伪静态规则包含 www.tuyuanma.com 重定向tuyuanma.com,http重定向https,搜索引擎自动http不影响收录的.htaccess规则:
& ]5 h* t0 U7 v! ]+ b3 P5 R- RewriteEngine on
9 [8 b5 Z* Z0 l+ A; Y& w5 ^ - RewriteCond %{http_host} ^www.<span style="color: rgb(0, 0, 0);">tuyuanma.com</span> [NC]
, D0 o7 e$ U# w" i/ B - RewriteRule ^(.*)$ https://<span style="color: rgb(0, 0, 0);">tuyuanma.com</span>/$1 [L,R=301]
6 ?7 _# e9 N* s6 r" N/ V m - RewriteCond %{SERVER_PORT} !^443$
( K4 ~3 L; i% { - RewriteCond %{HTTP_USER_AGENT} !(baiduspider|soso|bing|sogou|yahoo|sohu-search|yodao|robozilla|msnbot|msie|feedburner) [NC]
! q7 f8 b0 K2 ?" i0 |7 L9 L" s - RewriteRule (.*) https://<span style="color: rgb(0, 0, 0);">tuyuanma.com</span>/$1 [R=301,NC,L]
" Z' O/ @& p$ e; Y! {2 B - RewriteCond %{REQUEST_FILENAME} !-f
/ l* ?& Q! @# { - RewriteCond %{REQUEST_FILENAME} !-d" ~! n0 x) b2 Q0 S) K
- RewriteBase /
8 j# Y. @0 x9 `3 r) \% x) i: b+ n - RewriteRule ^(.*)$ /index.php/$1 [L]
复制代码
- x x, |; ]) s8 D) G! `- Z$ b% m6 `" v( L! P
|