Emlog开启全站https还是很方便的,直接在后台把地址修改为https的然后更新缓存数据就全站https了。https各大搜索引擎目前都不会很友好的收录,所以我们必须用规则来让引擎访问我们网站的时候打开的是http页面,这也是目前唯一http网站不影响收录的解决方案。IIS那种403跳转就算了吧,严重影响收录。 直接上分享,你懂的。 443配置(注意把3个服务器根证书也改成自己的路径):- <VirtualHost *:443>
* l* ` @) g, Z' f8 p - DocumentRoot /data/www/web/web0001/
! Q7 C4 ~$ L1 o% Z$ Q* P, ^: f* R - ServerName localhost:443
. y2 F) j& o% n# Q; {; O% ~ - SSLEngine on$ w! J. v' ^. B; {5 _ \5 @1 o, P
- SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
5 ]0 h: Z7 T# n - SSLCertificateFile /data/limhme.crt8 N' a! a$ b3 F) o% J) i
- SSLCertificateKeyFile /data/limhme.key
' u5 g/ i" g0 E6 M% ~" ~ - SSLCertificateChainFile /data/root_bundle.crt0 Z& L( ?& N0 ~" \! ~! M
- <FilesMatch "\.(cgi|shtml|phtml|php)$">& x& c2 f# j: D
- SSLOptions +StdEnvVars1 g3 n1 Q, E5 ~
- </FilesMatch>
/ i- n2 W& Q) ~! _: P% ?) D7 E - <Directory /data/www/web/web0001/>6 I) Z [2 I+ O" h- Y
- Order allow,deny
. _! K& \- g) `+ c1 i& T - Allow from all! m2 o2 k( k0 k5 H. j$ `' c% J
- Options Indexes FollowSymLinks+ Z5 u- T5 Y' N1 z' Z; x$ e8 f8 x
- AllowOverride All/ d8 A; \8 a! o0 Z3 B- y2 ]7 Z; ~
- </Directory>
; v" j7 f# X; f4 E/ ?: x6 i: u - BrowserMatch ".*MSIE.*" \
9 T4 H+ P0 _$ W) o7 U4 ~$ X6 p, l! o - nokeepalive ssl-unclean-shutdown \, l5 ?* v1 a7 T$ j
- downgrade-1.0 force-response-1.0
/ |: `$ S, r: F" C - ErrorLog logs/dummy-host.example.com-error_log) A5 b$ P: a: c& r$ U) c" O
- CustomLog logs/dummy-host.example.com-access_log common
( ?% Y, x3 M. o0 m - </VirtualHost>
复制代码 80配置:- <VirtualHost *>
% L( F8 t; z+ y2 N5 O& D; x0 o - DocumentRoot /data/www/web/web0001/( ?: k: \0 ~! l# j* z
- ServerName web0001
0 w' A8 m% @5 E: D - ServerAlias tuyuanma.com
) }- ~) l; w" c2 i9 c - ServerAlias www.tuyuanma.com/ b* O6 M* A! k' r8 q9 U: K
- <Directory /data/www/web/web0001/># v+ \9 V/ m7 |/ s
- AllowOverride FileInfo
/ d+ k# L% m% ]! ?' j) _ - </Directory>
* U) O3 H3 t" ?2 ? - </VirtualHost>
复制代码 Emlog伪静态规则包含 www.tuyuanma.com 重定向tuyuanma.com,http重定向https,搜索引擎自动http不影响收录的.htaccess规则:* o9 W) F6 m& @, N, J; \
- RewriteEngine on# v; H+ L& H2 i% } R- l4 t3 n9 j
- RewriteCond %{http_host} ^www.<span style="color: rgb(0, 0, 0);">tuyuanma.com</span> [NC]
0 w! S) E N/ I) i - RewriteRule ^(.*)$ https://<span style="color: rgb(0, 0, 0);">tuyuanma.com</span>/$1 [L,R=301]
8 ]$ ?: x7 G* \1 D _$ b - RewriteCond %{SERVER_PORT} !^443$) N' @% X* R/ P, ^
- RewriteCond %{HTTP_USER_AGENT} !(baiduspider|soso|bing|sogou|yahoo|sohu-search|yodao|robozilla|msnbot|msie|feedburner) [NC]: Y/ \ U( b9 P7 ]; |( Z
- RewriteRule (.*) https://<span style="color: rgb(0, 0, 0);">tuyuanma.com</span>/$1 [R=301,NC,L]# a; U' }7 @' Q9 U1 B |/ \4 O* F7 ]
- RewriteCond %{REQUEST_FILENAME} !-f! b6 f% o" p5 O, w8 b1 J
- RewriteCond %{REQUEST_FILENAME} !-d7 z, @, x* f" v6 y! g
- RewriteBase /
$ T- s: E5 [! D. N6 V* A, @7 a9 o - RewriteRule ^(.*)$ /index.php/$1 [L]
复制代码
. C! D+ t- ~- I
0 w3 v- I, d, g |