Emlog开启全站https还是很方便的,直接在后台把地址修改为https的然后更新缓存数据就全站https了。https各大搜索引擎目前都不会很友好的收录,所以我们必须用规则来让引擎访问我们网站的时候打开的是http页面,这也是目前唯一http网站不影响收录的解决方案。IIS那种403跳转就算了吧,严重影响收录。 直接上分享,你懂的。 443配置(注意把3个服务器根证书也改成自己的路径):- <VirtualHost *:443>
" r, n9 x! [: L4 @4 T - DocumentRoot /data/www/web/web0001/. g% b; ?! a/ V& [) I) k! h" U# @) z! y
- ServerName localhost:4432 b: X5 P& L; |+ C
- SSLEngine on
T# V5 L, ^& Z5 F8 |1 ~4 H - SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL1 b! w5 U3 H* c/ x7 T7 m- \- A
- SSLCertificateFile /data/limhme.crt/ V" ~& M# ^. W* i/ v
- SSLCertificateKeyFile /data/limhme.key
8 |* C6 S5 [+ f& S - SSLCertificateChainFile /data/root_bundle.crt5 t+ Q5 k' A6 q3 A
- <FilesMatch "\.(cgi|shtml|phtml|php)$">
, i, O4 O" Y1 y8 A6 w! f$ j& E - SSLOptions +StdEnvVars
% A1 T- c' y8 U+ p' b. Y5 | - </FilesMatch>) G, X( K# Y+ J& D: i4 ^) c2 ~8 I
- <Directory /data/www/web/web0001/>) p+ ?0 `9 B7 h, U8 ]
- Order allow,deny
: k% y8 T' V* \2 C8 Y/ t% v# }. P - Allow from all$ X: ]* Q4 o2 l, n7 A
- Options Indexes FollowSymLinks
$ K* x7 w, y1 J - AllowOverride All
+ h1 t3 H O$ N, e. m* n, G( ` - </Directory>
0 J' b: W9 ^; H - BrowserMatch ".*MSIE.*" \
7 q& q" t3 N( |: M: Z - nokeepalive ssl-unclean-shutdown \
4 b5 \9 @6 M( U; z# v/ } U: y, D5 U - downgrade-1.0 force-response-1.0: z/ b; ` r7 \' \! Q: @
- ErrorLog logs/dummy-host.example.com-error_log8 Z9 A/ `8 N( f7 H& p- V
- CustomLog logs/dummy-host.example.com-access_log common
# U# @! e8 c( a% D, s' H - </VirtualHost>
复制代码 80配置:- <VirtualHost *>
6 p0 }3 b: O( J7 O; W2 m. G - DocumentRoot /data/www/web/web0001/
, o9 q+ X" ^. g+ @# O - ServerName web0001
% o! q2 B7 q8 B' F - ServerAlias tuyuanma.com* t9 Q7 _/ Y' Q
- ServerAlias tuyuanma.com5 {6 Z; B& n- e2 F* O, r* ^" n/ R0 b
- <Directory /data/www/web/web0001/>0 R7 K3 m( a8 T! g: f. c
- AllowOverride FileInfo
) w7 _6 e& C! k! m: U! D - </Directory>7 ^- h7 ^% U2 t1 N' k
- </VirtualHost>
复制代码 Emlog伪静态规则包含 www.tuyuanma.com 重定向tuyuanma.com,http重定向https,搜索引擎自动http不影响收录的.htaccess规则:
- j5 O# c" Y* i G/ e8 N: H* j. {- RewriteEngine on! l7 z! p% C1 I1 w: n
- RewriteCond %{http_host} ^www.<span style="color: rgb(0, 0, 0);">tuyuanma.com</span> [NC]
3 F8 R5 B: x7 m+ u - RewriteRule ^(.*)$ https://<span style="color: rgb(0, 0, 0);">tuyuanma.com</span>/$1 [L,R=301]
2 k* e* K0 z1 ?3 v! ^. m - RewriteCond %{SERVER_PORT} !^443$& ]- K+ P F6 j: B- e2 P- ^
- RewriteCond %{HTTP_USER_AGENT} !(baiduspider|soso|bing|sogou|yahoo|sohu-search|yodao|robozilla|msnbot|msie|feedburner) [NC]
& ?8 d5 s. h9 Q9 X$ u7 J - RewriteRule (.*) https://<span style="color: rgb(0, 0, 0);">tuyuanma.com</span>/$1 [R=301,NC,L]9 d& e5 c- A) c. `$ Q: ~
- RewriteCond %{REQUEST_FILENAME} !-f1 [. O. C B# ^: f
- RewriteCond %{REQUEST_FILENAME} !-d
8 |6 t4 n" M! d# K1 \ - RewriteBase /) u- h/ r5 Z' v5 J1 X5 p
- RewriteRule ^(.*)$ /index.php/$1 [L]
复制代码 : E/ b4 y# O% @
* T1 z8 B/ w) F- t9 J
|