一直一来都在更新规则,但从来米有完整的写过一次规则方面的文章,这次就把偶编写的wordpress iis10 web.config代码放下来,并且做较详细的解释,希望对于有需要学习和了解这方面的前端或 wp开发人员有帮助,这也是自己多年来累积的代码及经验,希望更多的人用上这类规则或减少 wp站点的问题。
在这里只能把全部代码放在最开始,如果放到最后不好讲解,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 | <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <!-- BEGIN modules --> <modules> <!-- remove helicontech ape --> <remove name="Helicon.Ape" /> <!-- add uri- file- and token cache modules --> <!-- for iis output cache --> <add name="UriCacheModule" /> <add name="FileCacheModule" /> <add name="TokenCacheModule" /> </modules> <!-- END modules --> <!-- BEGIN handlers --> <handlers> <!-- Remove the existing php fastcgi handler, so we can add our own --> <remove name="php_via_fastcgi_5.3.x_x86" /> <remove name="php_via_fastcgi_5.4.x_x86" /> <remove name="php_via_fastcgi_5.5.x_x86" /> <remove name="php_via_fastcgi_5.6.x_x86" /> <remove name="php_via_fastcgi_5.6.x_x64" /> <remove name="php_via_fastcgi_7.0.x_x64" /> <remove name="php_via_fastcgi_7.1.x_x64" /> <remove name="php_via_fastcgi_7.2.x_x64" /> <remove name="php_via_fastcgi_7.3.x_x64" /> <!-- my php7 wincache php handler in iis, the scriptprocessor path is specific to my environment. due to a file system cache bug in wincache v1.3.7.4 for php 5.6, I'm running php 7/wincache. see @ www.saotn.org/php-wincache-on-iis/ for more php wincache configuration information --> <add name="php_via_fastcgi_7.3.x_x64" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files\php\php7.3.x_x64\php-cgi.exe" resourceType="File" allowPathInfo="true" requireAccess="Script" /> <!-- BEGIN php_via_fastcgi_5.3.x_x86 --> <!-- <add name="php_via_fastcgi_5.3.x_x86" path="*.php" verb="GET,HEAD,POST" type="" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\php\php5.3.x_x86\php-cgi.exe" resourceType="Either" requireAccess="Script" allowPathInfo="true" preCondition="" responseBufferLimit="0" /> --> <!-- flush invalid solution set responseBufferLimit="0",but will affect the ajax no refresh effect,become the page blank refresh effect. --> <!-- END PHP_via_FastCGI_5.6.x_x86 --> <!-- remove Perl (.cgi, .pl) if unused --> <remove name="Perl-CGI" /> <!-- remove Perl (.isapi, .pl) if unused --> <remove name="Perl-ISAPI" /> <!-- remove Perl (.cgi, .pl) if unused --> <remove name="PerlPLX" /> <!-- remove PHP3 (.php3) if unused --> <remove name="PHP3" /> <!-- remove PHP4 (.php4) if unused --> <remove name="PHP4" /> <!-- remove ISAPI_RewriteProxy 64-bit if unused --> <remove name="ISAPI_RewriteProxy-64" /> <!-- remove ISAPI_RewriteProxy if unused --> <remove name="ISAPI_RewriteProxy" /> <!-- remove PHP (.php) if unused --> <remove name="PHP" /> <!-- remove ISAPI-dll if unused --> <!-- <remove name="ISAPI-dll" /> <add name="ISAPI-dll" path="*.dll" verb="*" type="" modules="IsapiModule" scriptProcessor="" resourceType="File" requireAccess="Execute" allowPathInfo="true" preCondition="" responseBufferLimit="0" /> --> </handlers> <!-- END handlers --> <!-- <modules runAllManagedModulesForAllRequests="true" /> --> <!-- to browse the Web application root directory during debugging, set the following value to True. Setting the value to False before deploying prevents leakage of Web application folder information. --> <directoryBrowse enabled="false" /> <!-- request filtering. The following settings tell IIS to cancel the extension's restrictions. --> <security> <!-- BEGIN File name extensions --> <requestFiltering> <requestLimits maxAllowedContentLength="2147483647"></requestLimits> <fileExtensions applyToWebDAV="false"> <remove fileExtension=".rar" /> <remove fileExtension=".zip" /> <remove fileExtension=".7z" /> <remove fileExtension=".7-zip" /> <remove fileExtension=".tar.gz" /> <remove fileExtension=".cab" /> <remove fileExtension=".arj" /> <remove fileExtension=".lzh" /> <remove fileExtension=".ace" /> <remove fileExtension=".tar" /> <remove fileExtension=".gzip" /> <remove fileExtension=".uue" /> <remove fileExtension=".bz2" /> <remove fileExtension=".jar" /> <remove fileExtension=".z" /> <remove fileExtension=".ceb" /> <remove fileExtension=".mdb" /> <remove fileExtension=".md" /> <remove fileExtension=".cmd" /> <remove fileExtension=".log" /> <remove fileExtension=".reg" /> <remove fileExtension=".lng" /> <remove fileExtension=".inf" /> <remove fileExtension=".sql" /> <remove fileExtension=".ini" /> <remove fileExtension=".txt" /> <remove fileExtension=".xls" /> <remove fileExtension=".xlsx" /> <remove fileExtension=".doc" /> <remove fileExtension=".docx" /> <remove fileExtension=".pdf" /> <remove fileExtension=".pptx" /> <remove fileExtension=".rtf" /> <remove fileExtension=".wps" /> <remove fileExtension=".dps" /> <remove fileExtension=".et" /> <remove fileExtension=".wpt" /> <remove fileExtension=".dot" /> <remove fileExtension=".pps" /> <remove fileExtension=".pptm" /> <remove fileExtension=".potx" /> <remove fileExtension=".pot" /> <remove fileExtension=".ett" /> <remove fileExtension=".xlt" /> <remove fileExtension=".csv" /> <remove fileExtension=".fla" /> <remove fileExtension=".xml" /> <remove fileExtension=".rss" /> <remove fileExtension=".json" /> <remove fileExtension=".exe" /> <remove fileExtension=".msi" /> <remove fileExtension=".bat" /> <remove fileExtension=".dll" /> <remove fileExtension=".torrent" /> <remove fileExtension=".mp3" /> <remove fileExtension=".mp4" /> <remove fileExtension=".mpg" /> <remove fileExtension=".m4v" /> <remove fileExtension=".rm" /> <remove fileExtension=".rmvb" /> <remove fileExtension=".avi" /> <remove fileExtension=".wmv" /> <remove fileExtension=".wav" /> <remove fileExtension=".mkv" /> <remove fileExtension=".webm" /> <remove fileExtension=".ogv" /> <remove fileExtension=".flv" /> <remove fileExtension=".f4v" /> <remove fileExtension=".js" /> <remove fileExtension=".css" /> <remove fileExtension=".ttf" /> <remove fileExtension=".ttc" /> <remove fileExtension=".otf" /> <remove fileExtension=".woff" /> <remove fileExtension=".woff2" /> <remove fileExtension=".crx" /> <remove fileExtension=".xpi" /> <remove fileExtension=".safariextz" /> <remove fileExtension=".svg" /> <remove fileExtension=".svgz" /> <remove fileExtension=".bmp" /> <remove fileExtension=".png" /> <remove fileExtension=".gif" /> <remove fileExtension=".jpg" /> <remove fileExtension=".jpeg" /> <remove fileExtension=".webp" /> <remove fileExtension=".ico" /> <remove fileExtension=".htc" /> <remove fileExtension=".vcf" /> <remove fileExtension=".cur" /> <remove fileExtension=".psd" /> <remove fileExtension=".db" /> <remove fileExtension=".webapp" /> <remove fileExtension=".ds_store" /> <remove fileExtension=".apk" /> <remove fileExtension=".air" /> <remove fileExtension=".swf" /> <remove fileExtension=".asp" /> <remove fileExtension=".aspx" /> <remove fileExtension=".ashx" /> <remove fileExtension=".axd" /> <remove fileExtension=".asmx" /> <remove fileExtension=".php" /> <remove fileExtension=".jsp" /> <remove fileExtension=".do" /> <add fileExtension=".rar" allowed="false" /> <add fileExtension=".zip" allowed="false" /> <add fileExtension=".7z" allowed="false" /> <add fileExtension=".7-zip" allowed="false" /> <add fileExtension=".tar.gz" allowed="false" /> <add fileExtension=".cab" allowed="false" /> <add fileExtension=".arj" allowed="false" /> <add fileExtension=".lzh" allowed="false" /> <add fileExtension=".ace" allowed="false" /> <add fileExtension=".tar" allowed="false" /> <add fileExtension=".gzip" allowed="false" /> <add fileExtension=".uue" allowed="false" /> <add fileExtension=".bz2" allowed="false" /> <add fileExtension=".jar" allowed="false" /> <add fileExtension=".z" allowed="false" /> <add fileExtension=".ceb" allowed="false" /> <add fileExtension=".mdb" allowed="false" /> <add fileExtension=".md" allowed="false" /> <add fileExtension=".cmd" allowed="false" /> <add fileExtension=".log" allowed="false" /> <add fileExtension=".reg" allowed="false" /> <add fileExtension=".lng" allowed="false" /> <add fileExtension=".inf" allowed="false" /> <add fileExtension=".sql" allowed="false" /> <add fileExtension=".ini" allowed="false" /> <add fileExtension=".txt" allowed="true" /> <add fileExtension=".xls" allowed="false" /> <add fileExtension=".xlsx" allowed="false" /> <add fileExtension=".doc" allowed="false" /> <add fileExtension=".docx" allowed="false" /> <add fileExtension=".pdf" allowed="false" /> <add fileExtension=".pptx" allowed="false" /> <add fileExtension=".rtf" allowed="false" /> <add fileExtension=".wps" allowed="false" /> <add fileExtension=".dps" allowed="false" /> <add fileExtension=".et" allowed="false" /> <add fileExtension=".wpt" allowed="false" /> <add fileExtension=".dot" allowed="false" /> <add fileExtension=".pps" allowed="false" /> <add fileExtension=".pptm" allowed="false" /> <add fileExtension=".potx" allowed="false" /> <add fileExtension=".pot" allowed="false" /> <add fileExtension=".ett" allowed="false" /> <add fileExtension=".xlt" allowed="false" /> <add fileExtension=".csv" allowed="false" /> <add fileExtension=".fla" allowed="false" /> <add fileExtension=".xml" allowed="true" /> <add fileExtension=".rss" allowed="true" /> <add fileExtension=".json" allowed="true" /> <add fileExtension=".exe" allowed="false" /> <add fileExtension=".msi" allowed="false" /> <add fileExtension=".bat" allowed="false" /> <add fileExtension=".dll" allowed="false" /> <add fileExtension=".torrent" allowed="false" /> <add fileExtension=".mp3" allowed="false" /> <add fileExtension=".mp4" allowed="false" /> <add fileExtension=".mpg" allowed="false" /> <add fileExtension=".m4v" allowed="false" /> <add fileExtension=".rm" allowed="false" /> <add fileExtension=".rmvb" allowed="false" /> <add fileExtension=".avi" allowed="false" /> <add fileExtension=".wmv" allowed="false" /> <add fileExtension=".wav" allowed="false" /> <add fileExtension=".mkv" allowed="false" /> <add fileExtension=".webm" allowed="false" /> <add fileExtension=".ogv" allowed="false" /> <add fileExtension=".flv" allowed="false" /> <add fileExtension=".f4v" allowed="false" /> <add fileExtension=".js" allowed="true" /> <add fileExtension=".css" allowed="true" /> <add fileExtension=".ttf" allowed="true" /> <add fileExtension=".ttc" allowed="true" /> <add fileExtension=".otf" allowed="true" /> <add fileExtension=".woff" allowed="true" /> <add fileExtension=".woff2" allowed="true" /> <add fileExtension=".crx" allowed="true" /> <add fileExtension=".xpi" allowed="true" /> <add fileExtension=".safariextz" allowed="true" /> <add fileExtension=".svg" allowed="true" /> <add fileExtension=".svgz" allowed="true" /> <add fileExtension=".bmp" allowed="false" /> <add fileExtension=".png" allowed="true" /> <add fileExtension=".gif" allowed="true" /> <add fileExtension=".jpg" allowed="true" /> <add fileExtension=".jpeg" allowed="true" /> <add fileExtension=".webp" allowed="true" /> <add fileExtension=".ico" allowed="true" /> <add fileExtension=".htc" allowed="false" /> <add fileExtension=".vcf" allowed="false" /> <add fileExtension=".cur" allowed="false" /> <add fileExtension=".psd" allowed="false" /> <add fileExtension=".db" allowed="false" /> <add fileExtension=".webapp" allowed="false" /> <add fileExtension=".ds_store" allowed="false" /> <add fileExtension=".apk" allowed="false" /> <add fileExtension=".air" allowed="false" /> <add fileExtension=".swf" allowed="false" /> <add fileExtension=".asp" allowed="false" /> <add fileExtension=".aspx" allowed="false" /> <add fileExtension=".ashx" allowed="false" /> <add fileExtension=".axd" allowed="false" /> <add fileExtension=".asmx" allowed="false" /> <add fileExtension=".php" allowed="true" /> <add fileExtension=".jsp" allowed="false" /> <add fileExtension=".do" allowed="false" /> </fileExtensions> <!-- END File name extensions --> <!-- block out some known offending ip addresses. unfortunately, it is almost impossible to keep this up-to-date --> <!-- BEGIN block ip address --> <!-- END block ip address --> <!-- iis request filtering rules. block out some requests to known backdoors (or vulnerable scripts). watch out: names can vary... --> <!-- BEGIN iis request filtering rules --> <denyUrlSequences> <!-- <add sequence="engine" /> --> <!-- <add sequence="inc" /> Topbar style misplacement under login. --> <!-- <add sequence="info" /> --> <!-- <add sequence="module" /> --> <!-- <add sequence="profile" /> https://webkv.com/wp-admin/profile.php HTTP error 404.5 - Not Found,If not, then 404. --> <!-- <add sequence="po" /> https://webkv.com/wp-admin/edit.php HTTP error 404.5 - Not Found,If not, then 404. --> <!-- <add sequence="sh" /> Loss of icon background font under login. --> <!-- <add sequence="theme" /> Behind the theme page style dislocation. --> <!-- <add sequence="tpl(\.php" /> --> <!-- <add sequence="Root" /> --> <!-- <add sequence="Tag" /> https://webkv.com/wp-admin/edit-tags.php?taxonomy=us_portfolio_category&post_type=us_portfolio HTTP error 404.5 - Not Found,If not, then 404. --> <!-- <add sequence="Template" /> --> <!-- <add sequence="Repository" /> --> <!-- <add sequence="code-style" /> --> <!-- <add sequence="phpinfo.php" /> --> <add sequence="web.config" /> <add sequence="wp-admin/install.php" /> <add sequence="wp-includes/safe/waf.php" /> <add sequence="wp-includes/safe/safe.php" /> <add sequence="wp-config.php" /> <add sequence="ofc_upload_image.php" /> <add sequence="timthumb.php" /> <add sequence="img.php" /> <add sequence="img_x.php" /> <add sequence="thumb.php" /> <add sequence="phpthumb.php" /> <add sequence="kontol.php" /> <add sequence="magic.php.png" /> <add sequence="food.php" /> <add sequence="ph.php" /> <add sequence="fragile.php" /> <add sequence="3xp.php" /> <add sequence="explore.php" /> <add sequence="petx.php" /> <add sequence="dl-skin.php" /> <add sequence="direct_download.php" /> <add sequence="getfile.php" /> <add sequence="vito.php" /> <add sequence="upload_settings_image.php" /> <add sequence="saint.php" /> <add sequence="lunar.php" /> <add sequence="nyet.gif" /> <!-- /& uri --> <add sequence="/&" /> <add sequence="/login.php" /> <add sequence="magmi.php" /> <add sequence="url.php" /> <!-- <add sequence="html.php" /> --> </denyUrlSequences> <!-- yes, even my WordPress site gets scanned for Joomla --> <denyQueryStringSequences> <add sequence="option=com_jce&task=plugin&plugin=imgmanager&file=imgmanager&version=1576&cid=20" /> <!-- you can add query string sequences below, for example to (try to) block some sql injection or cross site scripting attacks, but only through http get: --> <add sequence="foobar=revslider" /> <add sequence="action=revslider_show_image&img=../wp-config.php" /> </denyQueryStringSequences> </requestFiltering> <!-- END iis request filtering rules --> </security> <!-- BEGIN directory browse --> <defaultDocument> <files> <clear /> <add value="index.php" /> <add value="default.htm" /> <add value="default.html" /> <add value="default.asp" /> <add value="default.aspx" /> <add value="index.pl" /> <add value="index.htm" /> <add value="index.html" /> <add value="iisstart.htm" /> <add value="index.shtm" /> <add value="index.shtml" /> <add value="index.asp" /> <add value="index.aspx" /> </files> </defaultDocument> <!-- END directory browse --> <rewrite> <rules> <!-- like as <add sequence="web.config" /> <add sequence="wp-admin/install.php" /> <add sequence="wp-includes/safe/waf.php" /> <add sequence="wp-includes/safe/safe.php" /> and more file type. --> <!-- BEGIN iis request filtering rules --> <!-- <rule name="Protect files and directories from prying eyes" stopProcessing="true"> <match url="\.(engine|inc|info|phpinfo(\.php)?|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$" /> <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." /> </rule> --> <!-- END iis request filtering rules --> <!-- blocking common malicious bot queries and fckeditor and slider revolution install. --> <!-- BEGIN block common malicious bot queries --> <rule name="Block common malicious bot queries" stopProcessing="true"> <match url=".*" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{QUERY_STRING}" pattern="http\:\/\/www\.google\.com\/humans\.txt\?" /> <add input="{QUERY_STRING}" pattern="(img|thumb|thumb_editor|thumbopen).php" /> <add input="{QUERY_STRING}" pattern="fckeditor" /> <!-- <add input="{QUERY_STRING}" pattern="revslider" /> --> </conditions> <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" /> </rule> <!-- END block common malicious bot queries --> <!-- blocking spider,the common spiders of search engines are as follows. googlespider:googlebot baiduspider:baiduspider yahoospider:slurp alexaspider:ia_archiver msnspider:msnbot bingspider:bingbot altavistaspider:scooter lycosspider:lycos_spider_(t-rex) allthewebspider:fast-webcrawler inktomispider:slurp yodaospider:YodaoBot和OutfoxBot adminrtspider:Adminrtspider sogouspider:sogou spider sosospider:sosospider 360spider:360spider --> <!-- BEGIN forbidden directory file download --> <rule name="Forbidden directory file download"> <match url="^wp-content/.*\.(shtm|shtml|htm|html|xml)$" ignoreCase="false" /> <action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" /> </rule> <!-- END forbidden directory file download --> <!-- BEGIN forbidimage search --> <!-- <rule name="Block spider"> <match url="(^robots.txt$)" ignoreCase="false" negate="true" /> <conditions> <add input="{HTTP_USER_AGENT}" pattern="Webdup|AcoonBot|AhrefsBot|Ezooms|EdisterBot|EC2LinkFinder|jikespider|Purebot|MJ12bot|WangIDSpider|WBSearchBot|Wotbox|xbfMozilla|Yottaa|YandexBot|Jorgee|SWEBot|spbot|TurnitinBot-Agent|curl|perl|Python|Wget|Xenu|ZmEu" ignoreCase="true" /> </conditions> <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" /> </rule> --> <!-- END forbidimage search --> <!-- BEGIN forbidimage domain --> <rule name="Forbidimage domain"> <!-- forbidimage domain all file type --> <match url=".*\.(mp3|mp4|mpg|m4v|rm|rmvb|avi|wmv|wav|mkv|webm|ogv|flv|f4v|js|css|ttf|ttc|otf|woff|woff2|crx|xpi|safariextz|svg|svgz|bmp|png|gif|jpg|jpeg|webp|swf)$" ignoreCase="false" /> <conditions> <!-- forbidimage all are not allowed(^$),because allowed($). --> <add input="{HTTP_REFERER}" pattern="^$" ignoreCase="false" negate="true" /> <!-- forbidimage domain allow --> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?(localhost|127.0.0.1|192.168.0.1|192.168.1.1|192.168.2.1|(.+\.)?domain1\.com|(.+\.)?domain2\.com|(.+\.)?domain3\.com|(.+\.)?webkv\.com)?(:(?:\d{4}))?(\.(?:com|net|org|gov|cc|tv|top|mobi|xyz|link|biz|name|site|tech|ink|vip|club|xin|online|co))?(\.(?:cn|hk|uk))?/.*$" negate="true" /> <!-- <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?(localhost)?(:(?:\d{4}))?(\.(?:com|net|org|gov|cc|tv|top|mobi|xyz|link|biz|name|site|tech|ink|vip|club|xin|online|co))?(\.(?:cn|hk|uk))?/.*$" negate="true" /> --> <!-- <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?localhost(:(?:8081|8082|8083|8084|8085|8086|8087|8088|8089|8090|8091|8092|8093|8094|8095|8096|8097|8098|8099|8100))?(\.(?:com|net|org|gov|cc|tv|top|mobi|xyz|link|biz|name|site|tech|ink|vip|club|xin|online|co))?(\.(?:cn|hk|uk))?/.*$" negate="true" /> --> <!-- forbidimage domain allow search --> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?baidu.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?baiducontent.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?google.com(\.hk)?/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?googleusercontent.com(\.hk)?/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?360.cn/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?so.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?360webcache.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?qq.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?soso.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sososnap.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sogou.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sogoucdn.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?youdao.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?(cn\.)?bing.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?bingj.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?yahoo.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?208.71.46.190/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?jike.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?zhongsou.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sina.com.cn/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sohu.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?feedsky.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?msn.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?feedburner.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?(e\.)?weibo.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?t.cn/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sm.cn/.*$" negate="true" /> <!-- forbidimage domain allow search tools --> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?bdstatic.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?qhres.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?qhimg.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?chinaz.com/.*$" negate="true" /> </conditions> <!-- <action type="Redirect" url="wp-content/plugins/my-custom-function-plugins/includes/web/HttpErrors/404_replace.png" redirectType="Found" /> --> <action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="Access to this website from the site you came from is prohibited!" /> </rule> <!-- END forbidimage domain --> <!-- BEGIN forbidimage --> <!-- <rule name="forbidimage" stopProcessing="true"> <match url="(.*)" ignoreCase="true" /> <conditions> <add input="{URL}" pattern="^/outlink" ignoreCase="false" negate="true" /> <add input="{REQUEST_FILENAME}" pattern="\.(rar|zip|7z|7-zip|tar|gz|cab|arj|lzh|ace|tar|gzip|uue|bz2|jar|z|ceb|mdb|md|cmd|log|reg|lng|inf|sql|ini|txt|xls|xlsx|doc|docx|pdf|pptx|rtf|wps|dps|et|wpt|dot|pps|pptm|potx|pot|ett|xlt|csv|fla|xml|rss|json|exe|msi|bat|dll|asp|aspx|ashx|axd|asmx|jsp|do|torrent|mp3|mp4|mpg|m4v|rm|rmvb|avi|wmv|wav|mkv|webm|ogv|flv|f4v|js|css|ttf|ttc|otf|woff|woff2|crx|xpi|safariextz|svg|svgz|bmp|png|gif|jpg|jpeg|webp|ico|htc|vcf|cur|psd|db|webapp|ds_store|apk|air|swf)$" ignoreCase="false" /> <add input="{HTTP_REFERER}" pattern="^$" ignoreCase="false" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?(localhost|127.0.0.1|192.168.0.1|192.168.1.1|192.168.2.1|(.+\.)?domain1\.com|(.+\.)?domain2\.com|(.+\.)?domain3\.com|(.+\.)?webkv\.com)?(:(?:\d{4}))?(\.(?:com|net|org|gov|cc|tv|top|mobi|xyz|link|biz|name|site|tech|ink|vip|club|xin|online|co))?(\.(?:cn|hk|uk))?/.*$" negate="true" /> </conditions> <action type="Redirect" redirectType="Found" url="wp-content/plugins/my-custom-function-plugins/includes/web/HttpErrors/404_replace.png" /> </rule> --> <!-- END forbidimage --> <!-- BEGIN forbidimage1 --> <!-- <rules> <rule name="forbidimage1" stopProcessing="true"> <match url=".*\.(gif|jpg|png)" /> <conditions> <add input="{HTTP_REFERER}" pattern="^http://localhost/.*$" negate="true" /> </conditions> <action type="Redirect" url="http://www.yougotodomain.com" /> </rule> --> <!-- END forbidimage1 --> <!-- BEGIN crossdomain --> <!-- <rule name="AddCrossDomain"> <match serverVariable="RESPONSE_Access_Control_Allow_Origin" pattern=".*" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> <add input="{HTTP_ORIGIN}" pattern="(http(s)?://((.+\.)?domain1\.com|(.+\.)?domain2\.com|(.+\.)?domain3\.com))" /> <add input="{HTTP_ORIGIN}" pattern="^http(s)?://(.+\.)?(domainname1|domainname2|domainname3)\.(?:com|net|org)$" /> </conditions> <action type="Rewrite" value="{C:0}" /> </rule> --> <!-- END crossdomain --> <!-- BEGIN http_to_https_redirect --> <!-- it must be placed before its "WP_Super_Cache_HTTP" and "wordpress rule 4",otherwise you can't jump from HTTP to HTTPS,because "/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index.html" overlay index page. --> <!-- <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" /> </rule> --> <!-- <rule name="example.com http to https" stopProcessing="true"> <match url="(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTP_HOST}" pattern="^(www.)?example\.com$" /> <add input="{HTTPS}" pattern="off" /> <add input="{URL}" pattern="(.*)" /> </conditions> <action type="Redirect" url="https://www.example.com/{R:1}" redirectType="Permanent" /> </rule> --> <!-- <rule name="Redirect to www subdomain"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" negate="true" /> <add input="{SERVER_PROTOCOL}" pattern="^(.*)(/.*)?$" /> </conditions> <action type="Redirect" url="{C:1}://www.{HTTP_HOST}/{R:0}" redirectType="Permanent" /> </rule> --> <!-- <rule name="Own website for sub domain"> <match url="(.*)" /> <conditions trackAllCaptures="true"> <add input="{HTTP_HOST}" pattern="^(foobar)\.example\.com$" /> <add input="{PATH_INFO}" pattern="^/\{C:1\}" negate="true" /> <add input="{HTTP_HOST}" pattern="^www" negate="true" /> </conditions> <action type="Rewrite" url="/{C:1}/{R:1}" /> --> <!-- END http_to_https_redirect --> <!-- step1: check the “enable proxy” checkbox located in application request routing feature view is iis manager. step2: add the following rule to the web site that will be used to proxy http requests: url="http://internalserver.com/{R:1}" step3: if use this proxy,please delete in "BEGIN wordpress" ... "END wordpress" all content,because there are some problems of repetition and rewriting between them. --> <!-- BEGIN proxy --> <!-- <rule name="proxy"> <match url="^(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^webkv.com$" /> </conditions> <action type="Rewrite" url="https://example.com/{R:1}" /> </rule> --> <!-- END proxy --> <!-- BEGIN wordpress --> <!-- BEGIN Imported --> <rule name="Imported Rule 1"> <match url="logout/" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{QUERY_STRING}" pattern="^action=logout$" /> </conditions> <action type="Rewrite" url="[NC]" /> </rule> <rule name="Imported Rule 2" stopProcessing="true"> <match url="^index\.php$" ignoreCase="false" /> <action type="None" /> </rule> <rule name="Imported Rule 3" stopProcessing="true"> <match url="." ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> </conditions> <action type="Rewrite" url="/index.php" /> </rule> <!-- END Imported --> <!-- BEGIN wordpress rule --> <rule name="wordpress rule 1" stopProcessing="true"> <match url="^index\.php$" ignoreCase="false" /> <action type="None" /> </rule> <rule name="wordpress rule 2" stopProcessing="true"> <match url="^files/(.+)" ignoreCase="false" /> <action type="Rewrite" url="wp-includes/ms-files.php?file={R:1}" appendQueryString="false" /> </rule> <rule name="wordpress rule 3" stopProcessing="true"> <match url="^wp-admin$" ignoreCase="false" /> <action type="Redirect" url="wp-admin/" redirectType="Permanent" /> </rule> <!-- wordpress rule 4,Unable to jump HTTP to HTTPS after opening. --> <rule name="wordpress rule 4" stopProcessing="true"> <match url="^" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" /> <!-- this addition prohibits access to a directory https://webkv.com/web such an empty link. at the same time, after modifying the https://webkv.com/wp-admin/options-permalink.php links, the front and back links of the entire website are invalid, resulting in the page can only open the home page, and the removal of this link will restore. because the same name directory exists in the website root directory, for example: (web|home|net|images|static). in this case, the use of static caching plug-ins such as wp rocket and wp super cache will lead to frequent chinese scrambling. --> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" /> </conditions> <action type="None" /> </rule> <rule name="wordpress rule 5" stopProcessing="true"> <match url="^(wp-(content|admin|includes).*)" ignoreCase="false" /> <action type="Rewrite" url="{R:1}" /> </rule> <rule name="wordpress rule 6" stopProcessing="true"> <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" /> <action type="Rewrite" url="{R:2}" /> </rule> <rule name="wordpress rule 7" stopProcessing="true"> <match url="." ignoreCase="false" /> <action type="Rewrite" url="index.php" /> </rule> <rule name="wordpress main rule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> <!-- wordpress chinese tag|category url 404 rule, wordpress includes php file for web.config modules --> <rule name="cnUrl" stopProcessing="true"> <match url="^(tag|category)/(.*)$" /> <action type="Rewrite" url="wp-content/plugins/my-custom-function-plugins/includes/plugins/cnurl/cnurl.php" /> </rule> <rule name="wordpress" patternSyntax="Wildcard"> <match url="*" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> <!-- END wordpress rule --> <!-- END wordpress --> <!-- BEGIN wp_super_cache --> <rule name="WP_Super_Cache_HTTPS_mobile_gzip" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author|wordpress_logged_in|wp-postpass)_.*$" negate="true" /> <add input="{HTTP_X_WAP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_USER_AGENT}" pattern="^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800|w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).*" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" /> <add input="{HTTPS}" pattern="on" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https-mobile.html.gz" matchType="IsFile" /> </conditions> <serverVariables> <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" /> <set name="HTTP_ACCEPT_ENCODING" value="" /> </serverVariables> <action type="Rewrite" url="/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https-mobile.html.gz" /> </rule> <!-- ssl in wordpress: how to move your wordpress site to https? the definitive guide --> <rule name="WP_Super_Cache_HTTPS_mobile" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTP_X_WAP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_USER_AGENT}" pattern="^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800|w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).*" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" negate="true" /> <add input="{HTTPS}" pattern="on" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https-mobile.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https-mobile.html" /> </rule> <rule name="WP_Super_Cache_HTTPS_gzip" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" /> <add input="{HTTPS}" pattern="on" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https.html.gz" matchType="IsFile" /> </conditions> <serverVariables> <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" /> <set name="HTTP_ACCEPT_ENCODING" value="" /> </serverVariables> <action type="Rewrite" url="/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https.html.gz" /> </rule> <rule name="WP_Super_Cache_HTTPS" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" negate="true" /> <add input="{HTTPS}" pattern="on" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https.html" /> </rule> <!-- this rule must rewrite plug-ins to take effect,because "/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index.html" overlay index page,please modify "index.html" to "index-http.html". --> <!-- <rule name="WP_Super_Cache_HTTP_gzip" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" /> <add input="{HTTPS}" pattern="on" negate="true" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-http.html.gz" matchType="IsFile" /> </conditions> <serverVariables> <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" /> <set name="HTTP_ACCEPT_ENCODING" value="" /> </serverVariables> <action type="Rewrite" url="/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-http.html.gz" /> </rule> <rule name="WP_Super_Cache_HTTP" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" negate="true" /> <add input="{HTTPS}" pattern="on" negate="true" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-http.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-http.html" /> </rule> --> <!-- rewrite everything else to wp-super-cache's index.html cache file,Unable to jump http to https after opening,because "/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index.html" overlay index page,please modify "index.html" to "index-http.html". --> <rule name="WP_Super_Cache_HTTP" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTPS}" pattern="on" negate="true" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index.html" /> </rule> <!-- old wp wuper cache rule. --> <!-- <rule name="wp super cache" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{QUERY_STRING}" pattern=".*attachment_id=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress|wp-postpass_).*$" negate="true" /> <add input="{HTTP_USER_AGENT}" pattern="^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).*" negate="true" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/supercache/{HTTP_HOST}/{R:1}index.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="wp-content/cache/supercache/{HTTP_HOST}/{R:1}index.html" /> </rule> --> <!-- END wp_super_cache --> <!-- BEGIN wp_rocket_cache --> <rule name="WP_Rocket_HTTPS_mobile_gzip" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <!-- <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> --> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{QUERY_STRING}" pattern=".*attachment_id=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author|wordpress_logged_in|wp-postpass)_.*$" negate="true" /> <add input="{HTTP_X_WAP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_USER_AGENT}" pattern="^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800|w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).*" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" /> <add input="{HTTPS}" pattern="on" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index-mobile-https.html_gzip" matchType="IsFile" /> </conditions> <serverVariables> <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" /> <set name="HTTP_ACCEPT_ENCODING" value="" /> </serverVariables> <action type="Rewrite" url="/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index-mobile-https.html_gzip" /> </rule> <!-- ssl in wordpress: how to move your wordpress site to https? the definitive guide --> <rule name="WP_Rocket_HTTPS_mobile" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <!-- <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> --> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{QUERY_STRING}" pattern=".*attachment_id=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTP_X_WAP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_USER_AGENT}" pattern="^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800|w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).*" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" negate="true" /> <add input="{HTTPS}" pattern="on" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index-mobile-https.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index-mobile-https.html" /> </rule> <rule name="WP_Rocket_HTTPS_gzip" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <!-- <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> --> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{QUERY_STRING}" pattern=".*attachment_id=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" /> <add input="{HTTPS}" pattern="on" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index-https.html_gzip" matchType="IsFile" /> </conditions> <serverVariables> <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" /> <set name="HTTP_ACCEPT_ENCODING" value="" /> </serverVariables> <action type="Rewrite" url="/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index-https.html_gzip" /> </rule> <rule name="WP_Rocket_HTTPS" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <!-- <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> --> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{QUERY_STRING}" pattern=".*attachment_id=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" negate="true" /> <add input="{HTTPS}" pattern="on" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index-https.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index-https.html" /> </rule> <rule name="WP_Rocket_HTTP_gzip" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <!-- <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> --> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{QUERY_STRING}" pattern=".*attachment_id=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" /> <add input="{HTTPS}" pattern="on" negate="true" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index.html_gzip" matchType="IsFile" /> </conditions> <serverVariables> <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" /> <set name="HTTP_ACCEPT_ENCODING" value="" /> </serverVariables> <action type="Rewrite" url="/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index.html_gzip" /> </rule> <rule name="WP_Rocket_HTTP" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <!-- <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> --> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{QUERY_STRING}" pattern=".*attachment_id=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <!-- <add input="{WP_ROCKET_BUSY}" pattern="true" negate="true"> --> <add input="{HTTPS}" pattern="on" negate="true" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="/wp-content/cache/wp-rocket/{SERVER_NAME}/{R:1}/index.html" /> </rule> <!-- check backup folder if css/js does not exist in primary directory. --> <rule name="Check backup folder if CSS/JS does not exist in primary directory" stopProcessing="true"> <match url="wp-content\/cache\/min\/1\/(.*)" /> <conditions> <add input="{DOCUMENT_ROOT}/wp-content/cache/min/1/{R:1}" matchType="IsFile" negate="true" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/min/backup/{R:1}" matchType="IsFile" /> </conditions> <action type="Rewrite" url="wp-content/cache/min/backup/{R:1}" /> </rule> <!-- old wp rocket rule. --> <!-- <rule name="WP Rocket" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{QUERY_STRING}" pattern=".*attachment_id=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress|wp-postpass_).*$" negate="true" /> <add input="{WP_ROCKET_BUSY}" pattern="true" negate="true" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/{HTTP_HOST}/{R:1}index-https.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="wp-content/cache/wp-rocket/{HTTP_HOST}/{R:1}index-https.html" /> </rule> --> <!-- END wp_rocket_cache --> <!-- BEGIN enable php code syntax highlighting --> <!-- <rule name="PHP Source Code" stopProcessing="true"> <match url="(.*\.php)s$" /> <conditions> <add input="{DOCUMENT_ROOT}\{R:1}" matchType="IsFile" /> </conditions> <action type="Rewrite" url="url.php?file={R:1}" appendQueryString="false" /> </rule> --> <!-- END enable php code syntax highlighting --> </rules> <outboundRules> <!-- remove server response header --> <rule name="Remove server header"> <match serverVariable="RESPONSE_Server" pattern=".+" /> <action type="Rewrite" value="" /> </rule> <!-- BEGIN hsts_iis --> <!-- <rule name="Add Strict-Transport-Security when HTTPS" enabled="true"> <match serverVariable="RESPONSE_Strict_Transport_Security" pattern=".*" /> <conditions> <add input="{HTTPS}" pattern="on" ignoreCase="true" /> </conditions> <action type="Rewrite" value="max-age=31536000" /> </rule> --> <!-- END hsts_iis --> </outboundRules> </rewrite> <!-- BEGIN httpErrors --> <httpErrors errorMode="DetailedLocalOnly"> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" prefixLanguageFilePath="" path="wp-content\plugins\my-custom-function-plugins\includes\web\HttpErrors\404.shtm" responseMode="File" /> </httpErrors> <!-- END httpErrors --> <!-- BEGIN httpRedirect --> <!-- <httpRedirect enabled="true" destination="https://webkv.com" childOnly="false" httpResponseStatus="Permanent" /> --> <!-- END httpRedirect --> <!-- urlCompression can give issues under certain circumstances --> <urlCompression doStaticCompression="true" doDynamicCompression="true" dynamicCompressionBeforeCache="true" /> <!-- remove and add some response headers --> <!-- BEGIN httpProtocol_Frame_Allow --> <httpProtocol> <customHeaders> <!-- remove response headers --> <remove name="X-Powered-By" /> <remove name="Vary" /> <remove name="ETag" /> <!-- prevent web pages from being frame and reverse proxy --> <add name="X-Frame-Options" value="SAMEORIGIN" /> <!-- implementing cross domain and input type --> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-Allow-Methods" value="GET,POST,PUT,DELETE,OPTIONS" /> <add name="Access-Control-Allow-Headers" value="Content-Type" /> <!-- may help against some types of drive-by-downloads --> <add name="X-Content-Type-Options" value="nosniff" /> <!-- may help against some types of cross-site scripting attacks --> <add name="X-XSS-Protection" value="1; mode=block" /> <!-- content security policy --> <!-- <add name="Content-Security-Policy" value="default-src 'self' webkv.com;" /> --> <!-- use google chrome frame in browser --> <add name="X-UA-Compatible" value="IE=Edge,chrome=1" /> <!-- set a Cache-Control header with max-age=691200 value --> <add name="Cache-Control" value="max-age=691200" /> <add name="Referrer-Policy" value="origin-when-cross-origin" /> <!-- set value="vibrate * or 'self' or 'none'; --> <!-- <add name="Feature-Policy" value="vibrate 'self';usermedia *;sync-xhr 'self' wordpress.org;" /> --> <!-- the homologous default policy can be applied to all accesses such as js file / picture / css / ajax requests, but this prevents all file access policies for external domains, unless you can determine which external urls are allowed to disable this. --> <!-- <add name="Content-Security-Policy" value="default-src 'self';style-src *;script-src *;usermedia *;" /> --> </customHeaders> </httpProtocol> <!-- END httpProtocol_Frame_Allow --> <!-- step1: launch your iis manager and go to the compression module. if it's not installed, go to the server manager, roles, web server. under role services, check your installed roles. if dynamic compression isn't installed, click add roles and install it. you can go back to compression for your site and ensure dynamic compression is checked. at this point, dynamic compression should be setup, but you really need to be specific about what mimeTypes will be compressed. back in iis manager, go to the page for the server, not the site. click on configuration editor: from the dropdown, select system.webServer/httpCompression: then click on dynamic types and now that you're in the list editor,think about what types you want compressed. by default */* is false, but you could just turn that on. i chose to be a little more picky and added application/atom+xml, application/json, and application/atom+xml;charset=utf-8 as seen below. it's a little gotcha that application/atom+xml and application/atom+xml;charset=utf-8 are separate entries.feel free to add what ever mimeTypes you like in here. after you've added them and closed the dialog, be sure to click apply and Restart your iis service to load the new module. step2: we need to set a mimetype for javascrip there, so configure some other types too. Notice minFileSizeForComp, this specifies the minimum number of kilobytes a file must contain in order to use on-demand compression. or command lines rule! if you find all this clicking and screenshots offensive, then do it all from the command line using appcmd for iis7.that's lovely also. //gzip json atom+xml atom+xml;charset=utf-8 %windir%/system32/inetsrv/appcmd.exe set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/json',enabled='True']" /commit:apphost %windir%/system32/inetsrv/appcmd.exe set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/atom%u002bxml',enabled='True']" /commit:apphost %windir%/system32/inetsrv/appcmd.exe set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/atom%u002bxml;charset=utf-8',enabled='True']" /commit:apphost --> <!-- BEGIN httpCompression --> <httpCompression minFileSizeForComp="0"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="7" /> <dynamicTypes> <clear/> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="*/*" enabled="false" /> <add mimeType="image/svg+xml" enabled="true" /> <add mimeType="application/font-woff" enabled="true" /> <add mimeType="application/x-font-ttf" enabled="true" /> <add mimeType="application/octet-stream" enabled="true" /> <add mimetype="application/json" enabled="true" /> <add mimetype="application/atom+xml" enabled="true" /> <add mimetype="application/atom+xml;charset=utf-8" enabled="true" /> </dynamicTypes> <staticTypes> <clear/> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="application/atom+xml" enabled="true" /> <add mimeType="application/xaml+xml" enabled="true" /> <add mimeType="*/*" enabled="false" /> <add mimeType="image/svg+xml" enabled="true" /> <add mimeType="application/font-woff" enabled="true" /> <add mimeType="application/font-woff2" enabled="true" /> <add mimeType="application/x-font-ttf" enabled="true" /> <add mimeType="application/octet-stream" enabled="true" /> <add mimetype="application/json" enabled="true" /> <add mimetype="application/atom+xml" enabled="true" /> <add mimetype="application/atom+xml;charset=utf-8" enabled="true" /> </staticTypes> </httpCompression> <!-- END httpCompression --> <!-- browser cache (or client cache), and mimeMappings for iis --> <!-- BEGIN browser cache and mimemappings --> <staticContent> <clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" /> <!-- <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" /> --> <remove fileExtension=".htm" /> <mimeMap fileExtension=".htm" mimeType="text/html;charset=UTF-8" /> <remove fileExtension=".html" /> <mimeMap fileExtension=".html" mimeType="text/html;charset=UTF-8" /> <remove fileExtension=".shtm" /> <mimeMap fileExtension=".shtm" mimeType="text/html;charset=UTF-8" /> <remove fileExtension=".shtml" /> <mimeMap fileExtension=".shtml" mimeType="text/html;charset=UTF-8" /> <remove fileExtension=".css" /> <mimeMap fileExtension=".css" mimeType="text/css" /> <remove fileExtension=".woff" /> <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> <remove fileExtension=".woff2" /> <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" /> <remove fileExtension=".js" /> <mimeMap fileExtension=".js" mimeType="application/x-javascript;charset=UTF-8" /> <remove fileExtension=".svg" /> <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> <!-- BEGIN gzip remove application/x-gzip or maybe to changed text/html --> <remove fileExtension=".gz" /> <mimeMap fileExtension=".gz" mimeType="application/x-gzip;charset=UTF-8" /> <!-- END gzip remove application/x-gzip or maybe to changed text/html --> </staticContent> <!-- after caching open, the specified caching type (htm,html,shtm,shtml,css,woff,js,svg,gz) returns 200 when the page is opened for the first time, and 304 when the page is refreshed by F5. If it is not 304 (after refresh), the local storage of the browser is not read, proving that there is no cache or that the client browser has disabled the cache. but some pages will automatically survive temporary merge files, such as js and css,/wp-content/cache/autoptimize/css/autoptimize_6c9ad88b45e32ed5bdbe0ef0a7a8a429.css, it still remains at 200,because itundefineds just been regenerated (new and different). --> <caching enabled="true" enableKernelCache="true"> <profiles> <!-- in the web.config file, iis uses the output caching module and the caching directive to control caching. for the sample application, you can enable caching for .html files for a maximum of 30 days. for .php files, ensure that no caching is performed at all with the code. --> <add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" /> <add extension=".htm" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="30:00:00:00" /> <add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="30:00:00:00" /> <add extension=".shtm" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="30:00:00:00" /> <add extension=".shtml" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="30:00:00:00" /> <add extension=".css" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="30:00:00:00" /> <add extension=".woff" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="30:00:00:00" /> <add extension=".js" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="30:00:00:00" /> <add extension=".svg" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="30:00:00:00" /> <add extension=".gz" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="30:00:00:00" /> </profiles> </caching> <!-- END Browser cache and mimeMappings --> </system.webServer> <!-- prohibit some configuration in web.config under the virtual directory inheritance root directory. --> <!-- BEGIN allowOverride true for wp super cache --> <location path="." allowOverride="true" inheritInChildApplications="false"> <!-- modify C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config in maxconnection. --> <system.net> <connectionManagement> <add address = "*" maxconnection = "24" /> <!-- specific ip. --> <add address="150.23.135.201" maxconnection = "12" /> </connectionManagement> </system.net> <system.web> <httpRuntime minFreeThreads="176" minLocalRequestFreeThreads="152" /> <!-- BEGIN customErrors --> <customErrors mode="Off" /> <!-- END customErrors --> <!-- BEGIN requestEncoding --> <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" /> <!-- END requestEncoding --> </system.web> </location> <!-- END allowOverride true for wp super cache --> </configuration> |
//第一段规则,一台空间php多个版本同时运行,例如:每个站点使用 1个php版本,a站点php5.3.x,b站点php5.6.x,c站点php7.3.x。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | <!-- BEGIN handlers --> <handlers> <!-- Remove the existing php fastcgi handler, so we can add our own --> <remove name="php_via_fastcgi_5.3.x_x86" /> <remove name="php_via_fastcgi_5.4.x_x86" /> <remove name="php_via_fastcgi_5.5.x_x86" /> <remove name="php_via_fastcgi_5.6.x_x86" /> <remove name="php_via_fastcgi_5.6.x_x64" /> <remove name="php_via_fastcgi_7.0.x_x64" /> <remove name="php_via_fastcgi_7.1.x_x64" /> <remove name="php_via_fastcgi_7.2.x_x64" /> <remove name="php_via_fastcgi_7.3.x_x64" /> <!-- my php7 wincache php handler in iis, the scriptprocessor path is specific to my environment. due to a file system cache bug in wincache v1.3.7.4 for php 5.6, I'm running php 7/wincache. see @ www.saotn.org/php-wincache-on-iis/ for more php wincache configuration information --> <add name="php_via_fastcgi_7.3.x_x64" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files\php\php7.3.x_x64\php-cgi.exe" resourceType="File" allowPathInfo="true" requireAccess="Script" /> <!-- BEGIN php_via_fastcgi_5.3.x_x86 --> <!-- <add name="php_via_fastcgi_5.3.x_x86" path="*.php" verb="GET,HEAD,POST" type="" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\php\php5.3.x_x86\php-cgi.exe" resourceType="Either" requireAccess="Script" allowPathInfo="true" preCondition="" responseBufferLimit="0" /> --> <!-- flush invalid solution set responseBufferLimit="0",but will affect the ajax no refresh effect,become the page blank refresh effect. --> <!-- END PHP_via_FastCGI_5.6.x_x86 --> <!-- remove Perl (.cgi, .pl) if unused --> <remove name="Perl-CGI" /> <!-- remove Perl (.isapi, .pl) if unused --> <remove name="Perl-ISAPI" /> <!-- remove Perl (.cgi, .pl) if unused --> <remove name="PerlPLX" /> <!-- remove PHP3 (.php3) if unused --> <remove name="PHP3" /> <!-- remove PHP4 (.php4) if unused --> <remove name="PHP4" /> <!-- remove ISAPI_RewriteProxy 64-bit if unused --> <remove name="ISAPI_RewriteProxy-64" /> <!-- remove ISAPI_RewriteProxy if unused --> <remove name="ISAPI_RewriteProxy" /> <!-- remove PHP (.php) if unused --> <remove name="PHP" /> <!-- remove ISAPI-dll if unused --> <!-- <remove name="ISAPI-dll" /> <add name="ISAPI-dll" path="*.dll" verb="*" type="" modules="IsapiModule" scriptProcessor="" resourceType="File" requireAccess="Execute" allowPathInfo="true" preCondition="" responseBufferLimit="0" /> --> </handlers> <!-- END handlers --> |
//不允许下载的扩展文件类型和不允许运行的文件夹或文件,例如,当前站点不允许下载 .sql .rar .zip等,和不允许运行phpinfo.php install.php等。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | <!-- to browse the Web application root directory during debugging, set the following value to True. Setting the value to False before deploying prevents leakage of Web application folder information. --> <directoryBrowse enabled="false" /> <!-- request filtering. The following settings tell IIS to cancel the extension's restrictions. --> <security> <!-- BEGIN File name extensions --> <requestFiltering> <requestLimits maxAllowedContentLength="2147483647"></requestLimits> <fileExtensions applyToWebDAV="false"> <remove fileExtension=".rar" /> <remove fileExtension=".zip" /> <remove fileExtension=".7z" /> <remove fileExtension=".7-zip" /> <remove fileExtension=".tar.gz" /> <remove fileExtension=".cab" /> <remove fileExtension=".arj" /> <remove fileExtension=".lzh" /> <remove fileExtension=".ace" /> <remove fileExtension=".tar" /> <remove fileExtension=".gzip" /> <remove fileExtension=".uue" /> <remove fileExtension=".bz2" /> <remove fileExtension=".jar" /> <remove fileExtension=".z" /> <remove fileExtension=".ceb" /> <remove fileExtension=".mdb" /> <remove fileExtension=".md" /> <remove fileExtension=".cmd" /> <remove fileExtension=".log" /> <remove fileExtension=".reg" /> <remove fileExtension=".lng" /> <remove fileExtension=".inf" /> <remove fileExtension=".sql" /> <remove fileExtension=".ini" /> <remove fileExtension=".txt" /> <remove fileExtension=".xls" /> <remove fileExtension=".xlsx" /> <remove fileExtension=".doc" /> <remove fileExtension=".docx" /> <remove fileExtension=".pdf" /> <remove fileExtension=".pptx" /> <remove fileExtension=".rtf" /> <remove fileExtension=".wps" /> <remove fileExtension=".dps" /> <remove fileExtension=".et" /> <remove fileExtension=".wpt" /> <remove fileExtension=".dot" /> <remove fileExtension=".pps" /> <remove fileExtension=".pptm" /> <remove fileExtension=".potx" /> <remove fileExtension=".pot" /> <remove fileExtension=".ett" /> <remove fileExtension=".xlt" /> <remove fileExtension=".csv" /> <remove fileExtension=".fla" /> <remove fileExtension=".xml" /> <remove fileExtension=".rss" /> <remove fileExtension=".json" /> <remove fileExtension=".exe" /> <remove fileExtension=".msi" /> <remove fileExtension=".bat" /> <remove fileExtension=".dll" /> <remove fileExtension=".torrent" /> <remove fileExtension=".mp3" /> <remove fileExtension=".mp4" /> <remove fileExtension=".mpg" /> <remove fileExtension=".m4v" /> <remove fileExtension=".rm" /> <remove fileExtension=".rmvb" /> <remove fileExtension=".avi" /> <remove fileExtension=".wmv" /> <remove fileExtension=".wav" /> <remove fileExtension=".mkv" /> <remove fileExtension=".webm" /> <remove fileExtension=".ogv" /> <remove fileExtension=".flv" /> <remove fileExtension=".f4v" /> <remove fileExtension=".js" /> <remove fileExtension=".css" /> <remove fileExtension=".ttf" /> <remove fileExtension=".ttc" /> <remove fileExtension=".otf" /> <remove fileExtension=".woff" /> <remove fileExtension=".woff2" /> <remove fileExtension=".crx" /> <remove fileExtension=".xpi" /> <remove fileExtension=".safariextz" /> <remove fileExtension=".svg" /> <remove fileExtension=".svgz" /> <remove fileExtension=".bmp" /> <remove fileExtension=".png" /> <remove fileExtension=".gif" /> <remove fileExtension=".jpg" /> <remove fileExtension=".jpeg" /> <remove fileExtension=".webp" /> <remove fileExtension=".ico" /> <remove fileExtension=".htc" /> <remove fileExtension=".vcf" /> <remove fileExtension=".cur" /> <remove fileExtension=".psd" /> <remove fileExtension=".db" /> <remove fileExtension=".webapp" /> <remove fileExtension=".ds_store" /> <remove fileExtension=".apk" /> <remove fileExtension=".air" /> <remove fileExtension=".swf" /> <remove fileExtension=".asp" /> <remove fileExtension=".aspx" /> <remove fileExtension=".ashx" /> <remove fileExtension=".axd" /> <remove fileExtension=".asmx" /> <remove fileExtension=".php" /> <remove fileExtension=".jsp" /> <remove fileExtension=".do" /> <add fileExtension=".rar" allowed="false" /> <add fileExtension=".zip" allowed="false" /> <add fileExtension=".7z" allowed="false" /> <add fileExtension=".7-zip" allowed="false" /> <add fileExtension=".tar.gz" allowed="false" /> <add fileExtension=".cab" allowed="false" /> <add fileExtension=".arj" allowed="false" /> <add fileExtension=".lzh" allowed="false" /> <add fileExtension=".ace" allowed="false" /> <add fileExtension=".tar" allowed="false" /> <add fileExtension=".gzip" allowed="false" /> <add fileExtension=".uue" allowed="false" /> <add fileExtension=".bz2" allowed="false" /> <add fileExtension=".jar" allowed="false" /> <add fileExtension=".z" allowed="false" /> <add fileExtension=".ceb" allowed="false" /> <add fileExtension=".mdb" allowed="false" /> <add fileExtension=".md" allowed="false" /> <add fileExtension=".cmd" allowed="false" /> <add fileExtension=".log" allowed="false" /> <add fileExtension=".reg" allowed="false" /> <add fileExtension=".lng" allowed="false" /> <add fileExtension=".inf" allowed="false" /> <add fileExtension=".sql" allowed="false" /> <add fileExtension=".ini" allowed="false" /> <add fileExtension=".txt" allowed="true" /> <add fileExtension=".xls" allowed="false" /> <add fileExtension=".xlsx" allowed="false" /> <add fileExtension=".doc" allowed="false" /> <add fileExtension=".docx" allowed="false" /> <add fileExtension=".pdf" allowed="false" /> <add fileExtension=".pptx" allowed="false" /> <add fileExtension=".rtf" allowed="false" /> <add fileExtension=".wps" allowed="false" /> <add fileExtension=".dps" allowed="false" /> <add fileExtension=".et" allowed="false" /> <add fileExtension=".wpt" allowed="false" /> <add fileExtension=".dot" allowed="false" /> <add fileExtension=".pps" allowed="false" /> <add fileExtension=".pptm" allowed="false" /> <add fileExtension=".potx" allowed="false" /> <add fileExtension=".pot" allowed="false" /> <add fileExtension=".ett" allowed="false" /> <add fileExtension=".xlt" allowed="false" /> <add fileExtension=".csv" allowed="false" /> <add fileExtension=".fla" allowed="false" /> <add fileExtension=".xml" allowed="true" /> <add fileExtension=".rss" allowed="true" /> <add fileExtension=".json" allowed="true" /> <add fileExtension=".exe" allowed="false" /> <add fileExtension=".msi" allowed="false" /> <add fileExtension=".bat" allowed="false" /> <add fileExtension=".dll" allowed="false" /> <add fileExtension=".torrent" allowed="false" /> <add fileExtension=".mp3" allowed="false" /> <add fileExtension=".mp4" allowed="false" /> <add fileExtension=".mpg" allowed="false" /> <add fileExtension=".m4v" allowed="false" /> <add fileExtension=".rm" allowed="false" /> <add fileExtension=".rmvb" allowed="false" /> <add fileExtension=".avi" allowed="false" /> <add fileExtension=".wmv" allowed="false" /> <add fileExtension=".wav" allowed="false" /> <add fileExtension=".mkv" allowed="false" /> <add fileExtension=".webm" allowed="false" /> <add fileExtension=".ogv" allowed="false" /> <add fileExtension=".flv" allowed="false" /> <add fileExtension=".f4v" allowed="false" /> <add fileExtension=".js" allowed="true" /> <add fileExtension=".css" allowed="true" /> <add fileExtension=".ttf" allowed="true" /> <add fileExtension=".ttc" allowed="true" /> <add fileExtension=".otf" allowed="true" /> <add fileExtension=".woff" allowed="true" /> <add fileExtension=".woff2" allowed="true" /> <add fileExtension=".crx" allowed="true" /> <add fileExtension=".xpi" allowed="true" /> <add fileExtension=".safariextz" allowed="true" /> <add fileExtension=".svg" allowed="true" /> <add fileExtension=".svgz" allowed="true" /> <add fileExtension=".bmp" allowed="false" /> <add fileExtension=".png" allowed="true" /> <add fileExtension=".gif" allowed="true" /> <add fileExtension=".jpg" allowed="true" /> <add fileExtension=".jpeg" allowed="true" /> <add fileExtension=".webp" allowed="true" /> <add fileExtension=".ico" allowed="true" /> <add fileExtension=".htc" allowed="false" /> <add fileExtension=".vcf" allowed="false" /> <add fileExtension=".cur" allowed="false" /> <add fileExtension=".psd" allowed="false" /> <add fileExtension=".db" allowed="false" /> <add fileExtension=".webapp" allowed="false" /> <add fileExtension=".ds_store" allowed="false" /> <add fileExtension=".apk" allowed="false" /> <add fileExtension=".air" allowed="false" /> <add fileExtension=".swf" allowed="false" /> <add fileExtension=".asp" allowed="false" /> <add fileExtension=".aspx" allowed="false" /> <add fileExtension=".ashx" allowed="false" /> <add fileExtension=".axd" allowed="false" /> <add fileExtension=".asmx" allowed="false" /> <add fileExtension=".php" allowed="true" /> <add fileExtension=".jsp" allowed="false" /> <add fileExtension=".do" allowed="false" /> </fileExtensions> <!-- END File name extensions --> <!-- block out some known offending ip addresses. unfortunately, it is almost impossible to keep this up-to-date --> <!-- BEGIN block ip address --> <!-- END block ip address --> <!-- iis request filtering rules. block out some requests to known backdoors (or vulnerable scripts). watch out: names can vary... --> <!-- BEGIN iis request filtering rules --> <denyUrlSequences> <!-- <add sequence="engine" /> --> <!-- <add sequence="inc" /> Topbar style misplacement under login. --> <!-- <add sequence="info" /> --> <!-- <add sequence="module" /> --> <!-- <add sequence="profile" /> https://webkv.com/wp-admin/profile.php HTTP error 404.5 - Not Found,If not, then 404. --> <!-- <add sequence="po" /> https://webkv.com/wp-admin/edit.php HTTP error 404.5 - Not Found,If not, then 404. --> <!-- <add sequence="sh" /> Loss of icon background font under login. --> <!-- <add sequence="theme" /> Behind the theme page style dislocation. --> <!-- <add sequence="tpl(\.php" /> --> <!-- <add sequence="Root" /> --> <!-- <add sequence="Tag" /> https://webkv.com/wp-admin/edit-tags.php?taxonomy=us_portfolio_category&post_type=us_portfolio HTTP error 404.5 - Not Found,If not, then 404. --> <!-- <add sequence="Template" /> --> <!-- <add sequence="Repository" /> --> <!-- <add sequence="code-style" /> --> <!-- <add sequence="phpinfo.php" /> --> <add sequence="web.config" /> <add sequence="wp-admin/install.php" /> <add sequence="wp-includes/safe/waf.php" /> <add sequence="wp-includes/safe/safe.php" /> <add sequence="wp-config.php" /> <add sequence="ofc_upload_image.php" /> <add sequence="timthumb.php" /> <add sequence="img.php" /> <add sequence="img_x.php" /> <add sequence="thumb.php" /> <add sequence="phpthumb.php" /> <add sequence="kontol.php" /> <add sequence="magic.php.png" /> <add sequence="food.php" /> <add sequence="ph.php" /> <add sequence="fragile.php" /> <add sequence="3xp.php" /> <add sequence="explore.php" /> <add sequence="petx.php" /> <add sequence="dl-skin.php" /> <add sequence="direct_download.php" /> <add sequence="getfile.php" /> <add sequence="vito.php" /> <add sequence="upload_settings_image.php" /> <add sequence="saint.php" /> <add sequence="lunar.php" /> <add sequence="nyet.gif" /> <!-- /& uri --> <add sequence="/&" /> <add sequence="/login.php" /> <add sequence="magmi.php" /> <add sequence="url.php" /> <!-- <add sequence="html.php" /> --> </denyUrlSequences> <!-- yes, even my WordPress site gets scanned for Joomla --> <denyQueryStringSequences> <add sequence="option=com_jce&task=plugin&plugin=imgmanager&file=imgmanager&version=1576&cid=20" /> <!-- you can add query string sequences below, for example to (try to) block some sql injection or cross site scripting attacks, but only through http get: --> <add sequence="foobar=revslider" /> <add sequence="action=revslider_show_image&img=../wp-config.php" /> </denyQueryStringSequences> </requestFiltering> <!-- END iis request filtering rules --> </security> |
//网站目录的索引及顺序,例如网站入口文件 index.php index.shtml default.aspx等,越排上面优先级越高,访问域名时,排最上面的文件索引文件被优先访问,如果不存在,则依次访问其后的索引文件。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <!-- BEGIN directory browse --> <defaultDocument> <files> <clear /> <add value="index.php" /> <add value="default.htm" /> <add value="default.html" /> <add value="default.asp" /> <add value="default.aspx" /> <add value="index.pl" /> <add value="index.htm" /> <add value="index.html" /> <add value="iisstart.htm" /> <add value="index.shtm" /> <add value="index.shtml" /> <add value="index.asp" /> <add value="index.aspx" /> </files> </defaultDocument> <!-- END directory browse --> |
//具体文件夹和文件,搜索引擎蜘蛛的防盗链接
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <!-- like as <add sequence="web.config" /> <add sequence="wp-admin/install.php" /> <add sequence="wp-includes/safe/waf.php" /> <add sequence="wp-includes/safe/safe.php" /> and more file type. --> <!-- BEGIN iis request filtering rules --> <!-- <rule name="Protect files and directories from prying eyes" stopProcessing="true"> <match url="\.(engine|inc|info|phpinfo(\.php)?|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$" /> <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." /> </rule> --> <!-- END iis request filtering rules --> <!-- blocking common malicious bot queries and fckeditor and slider revolution install. --> <!-- BEGIN block common malicious bot queries --> <rule name="Block common malicious bot queries" stopProcessing="true"> <match url=".*" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{QUERY_STRING}" pattern="http\:\/\/www\.google\.com\/humans\.txt\?" /> <add input="{QUERY_STRING}" pattern="(img|thumb|thumb_editor|thumbopen).php" /> <add input="{QUERY_STRING}" pattern="fckeditor" /> <!-- <add input="{QUERY_STRING}" pattern="revslider" /> --> </conditions> <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" /> </rule> <!-- END block common malicious bot queries --> <!-- blocking spider,the common spiders of search engines are as follows. googlespider:googlebot baiduspider:baiduspider yahoospider:slurp alexaspider:ia_archiver msnspider:msnbot bingspider:bingbot altavistaspider:scooter lycosspider:lycos_spider_(t-rex) allthewebspider:fast-webcrawler inktomispider:slurp yodaospider:YodaoBot和OutfoxBot adminrtspider:Adminrtspider sogouspider:sogou spider sosospider:sosospider 360spider:360spider --> |
//这个是具体不允许文件夹和文件类型的访问, 根据文件类型决定, 例如你如果想直接访问主题或模板目录想看到或下载页面,则 503拒绝访问。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <!-- BEGIN forbidden directory file download --> <rule name="Forbidden directory file download"> <match url="^wp-content/.*\.(shtm|shtml|htm|html|xml)$" ignoreCase="false" /> <action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" /> </rule> <!-- END forbidden directory file download --> <!-- BEGIN forbidimage search --> <!-- <rule name="Block spider"> <match url="(^robots.txt$)" ignoreCase="false" negate="true" /> <conditions> <add input="{HTTP_USER_AGENT}" pattern="Webdup|AcoonBot|AhrefsBot|Ezooms|EdisterBot|EC2LinkFinder|jikespider|Purebot|MJ12bot|WangIDSpider|WBSearchBot|Wotbox|xbfMozilla|Yottaa|YandexBot|Jorgee|SWEBot|spbot|TurnitinBot-Agent|curl|perl|Python|Wget|Xenu|ZmEu" ignoreCase="true" /> </conditions> <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" /> </rule> --> <!-- END forbidimage search --> |
//网站防盗链,不允许图片和静态文件类型的访问,例如:.jpg .gif .png .css .js .svg等的文件不允许从当前之外域名访问。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | <!-- BEGIN forbidimage domain --> <rule name="Forbidimage domain"> <!-- forbidimage domain all file type --> <match url=".*\.(mp3|mp4|mpg|m4v|rm|rmvb|avi|wmv|wav|mkv|webm|ogv|flv|f4v|js|css|ttf|ttc|otf|woff|woff2|crx|xpi|safariextz|svg|svgz|bmp|png|gif|jpg|jpeg|webp|swf)$" ignoreCase="false" /> <conditions> <!-- forbidimage all are not allowed(^$),because allowed($). --> <add input="{HTTP_REFERER}" pattern="^$" ignoreCase="false" negate="true" /> <!-- forbidimage domain allow --> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?(localhost|127.0.0.1|192.168.0.1|192.168.1.1|192.168.2.1|(.+\.)?domain1\.com|(.+\.)?domain2\.com|(.+\.)?domain3\.com|(.+\.)?webkv\.com)?(:(?:\d{4}))?(\.(?:com|net|org|gov|cc|tv|top|mobi|xyz|link|biz|name|site|tech|ink|vip|club|xin|online|co))?(\.(?:cn|hk|uk))?/.*$" negate="true" /> <!-- <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?(localhost)?(:(?:\d{4}))?(\.(?:com|net|org|gov|cc|tv|top|mobi|xyz|link|biz|name|site|tech|ink|vip|club|xin|online|co))?(\.(?:cn|hk|uk))?/.*$" negate="true" /> --> <!-- <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?localhost(:(?:8081|8082|8083|8084|8085|8086|8087|8088|8089|8090|8091|8092|8093|8094|8095|8096|8097|8098|8099|8100))?(\.(?:com|net|org|gov|cc|tv|top|mobi|xyz|link|biz|name|site|tech|ink|vip|club|xin|online|co))?(\.(?:cn|hk|uk))?/.*$" negate="true" /> --> <!-- forbidimage domain allow search --> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?baidu.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?baiducontent.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?google.com(\.hk)?/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?googleusercontent.com(\.hk)?/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?360.cn/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?so.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?360webcache.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?qq.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?soso.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sososnap.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sogou.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sogoucdn.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?youdao.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?(cn\.)?bing.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?bingj.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?yahoo.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?208.71.46.190/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?jike.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?zhongsou.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sina.com.cn/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sohu.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?feedsky.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?msn.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?feedburner.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?(e\.)?weibo.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?t.cn/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?sm.cn/.*$" negate="true" /> <!-- forbidimage domain allow search tools --> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?bdstatic.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?qhres.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?qhimg.com/.*$" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?chinaz.com/.*$" negate="true" /> </conditions> <!-- <action type="Redirect" url="wp-content/plugins/my-custom-function-plugins/includes/web/HttpErrors/404_replace.png" redirectType="Found" /> --> <action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="Access to this website from the site you came from is prohibited!" /> </rule> <!-- END forbidimage domain --> <!-- BEGIN forbidimage --> <!-- <rule name="forbidimage" stopProcessing="true"> <match url="(.*)" ignoreCase="true" /> <conditions> <add input="{URL}" pattern="^/outlink" ignoreCase="false" negate="true" /> <add input="{REQUEST_FILENAME}" pattern="\.(rar|zip|7z|7-zip|tar|gz|cab|arj|lzh|ace|tar|gzip|uue|bz2|jar|z|ceb|mdb|md|cmd|log|reg|lng|inf|sql|ini|txt|xls|xlsx|doc|docx|pdf|pptx|rtf|wps|dps|et|wpt|dot|pps|pptm|potx|pot|ett|xlt|csv|fla|xml|rss|json|exe|msi|bat|dll|asp|aspx|ashx|axd|asmx|jsp|do|torrent|mp3|mp4|mpg|m4v|rm|rmvb|avi|wmv|wav|mkv|webm|ogv|flv|f4v|js|css|ttf|ttc|otf|woff|woff2|crx|xpi|safariextz|svg|svgz|bmp|png|gif|jpg|jpeg|webp|ico|htc|vcf|cur|psd|db|webapp|ds_store|apk|air|swf)$" ignoreCase="false" /> <add input="{HTTP_REFERER}" pattern="^$" ignoreCase="false" negate="true" /> <add input="{HTTP_REFERER}" pattern="^http(s)?://(.*\.)?(localhost|127.0.0.1|192.168.0.1|192.168.1.1|192.168.2.1|(.+\.)?domain1\.com|(.+\.)?domain2\.com|(.+\.)?domain3\.com|(.+\.)?webkv\.com)?(:(?:\d{4}))?(\.(?:com|net|org|gov|cc|tv|top|mobi|xyz|link|biz|name|site|tech|ink|vip|club|xin|online|co))?(\.(?:cn|hk|uk))?/.*$" negate="true" /> </conditions> <action type="Redirect" redirectType="Found" url="wp-content/plugins/my-custom-function-plugins/includes/web/HttpErrors/404_replace.png" /> </rule> --> <!-- END forbidimage --> <!-- BEGIN forbidimage1 --> <!-- <rules> <rule name="forbidimage1" stopProcessing="true"> <match url=".*\.(gif|jpg|png)" /> <conditions> <add input="{HTTP_REFERER}" pattern="^http://localhost/.*$" negate="true" /> </conditions> <action type="Redirect" url="http://www.yougotodomain.com" /> </rule> --> <!-- END forbidimage1 --> |
//允许网站跨域名访问的规则
1 2 3 4 5 6 7 8 9 10 | <!-- BEGIN crossdomain --> <!-- <rule name="AddCrossDomain"> <match serverVariable="RESPONSE_Access_Control_Allow_Origin" pattern=".*" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> <add input="{HTTP_ORIGIN}" pattern="(http(s)?://((.+\.)?domain1\.com|(.+\.)?domain2\.com|(.+\.)?domain3\.com))" /> <add input="{HTTP_ORIGIN}" pattern="^http(s)?://(.+\.)?(domainname1|domainname2|domainname3)\.(?:com|net|org)$" /> </conditions> <action type="Rewrite" value="{C:0}" /> </rule> --> <!-- END crossdomain --> |
//域名301跳转的规则,像 http to https,二级域名跳转至其它主域名等。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | <!-- BEGIN http_to_https_redirect --> <!-- it must be placed before its "WP_Super_Cache_HTTP" and "wordpress rule 4",otherwise you can't jump from HTTP to HTTPS,because "/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index.html" overlay index page. --> <!-- <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" /> </rule> --> <!-- <rule name="example.com http to https" stopProcessing="true"> <match url="(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTP_HOST}" pattern="^(www.)?example\.com$" /> <add input="{HTTPS}" pattern="off" /> <add input="{URL}" pattern="(.*)" /> </conditions> <action type="Redirect" url="https://www.example.com/{R:1}" redirectType="Permanent" /> </rule> --> <!-- <rule name="Redirect to www subdomain"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" negate="true" /> <add input="{SERVER_PROTOCOL}" pattern="^(.*)(/.*)?$" /> </conditions> <action type="Redirect" url="{C:1}://www.{HTTP_HOST}/{R:0}" redirectType="Permanent" /> </rule> --> <!-- <rule name="Own website for sub domain"> <match url="(.*)" /> <conditions trackAllCaptures="true"> <add input="{HTTP_HOST}" pattern="^(foobar)\.example\.com$" /> <add input="{PATH_INFO}" pattern="^/\{C:1\}" negate="true" /> <add input="{HTTP_HOST}" pattern="^www" negate="true" /> </conditions> <action type="Rewrite" url="/{C:1}/{R:1}" /> --> <!-- END http_to_https_redirect --> |
//反向代理规则,这个需要安装iis的 requestrouter和rewrite伪静态规则组件。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <!-- step1: check the “enable proxy” checkbox located in application request routing feature view is iis manager. step2: add the following rule to the web site that will be used to proxy http requests: url="http://internalserver.com/{R:1}" step3: if use this proxy,please delete in "BEGIN wordpress" ... "END wordpress" all content,because there are some problems of repetition and rewriting between them. --> <!-- BEGIN proxy --> <!-- <rule name="proxy"> <match url="^(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^webkv.com$" /> </conditions> <action type="Rewrite" url="https://example.com/{R:1}" /> </rule> --> <!-- END proxy --> |
//wordpress规则,这个可以根据需要选择,已经非常全了,应对各种配置。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | <!-- BEGIN wordpress --> <!-- BEGIN Imported --> <rule name="Imported Rule 1"> <match url="logout/" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{QUERY_STRING}" pattern="^action=logout$" /> </conditions> <action type="Rewrite" url="[NC]" /> </rule> <rule name="Imported Rule 2" stopProcessing="true"> <match url="^index\.php$" ignoreCase="false" /> <action type="None" /> </rule> <rule name="Imported Rule 3" stopProcessing="true"> <match url="." ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> </conditions> <action type="Rewrite" url="/index.php" /> </rule> <!-- END Imported --> <!-- BEGIN wordpress rule --> <rule name="wordpress rule 1" stopProcessing="true"> <match url="^index\.php$" ignoreCase="false" /> <action type="None" /> </rule> <rule name="wordpress rule 2" stopProcessing="true"> <match url="^files/(.+)" ignoreCase="false" /> <action type="Rewrite" url="wp-includes/ms-files.php?file={R:1}" appendQueryString="false" /> </rule> <rule name="wordpress rule 3" stopProcessing="true"> <match url="^wp-admin$" ignoreCase="false" /> <action type="Redirect" url="wp-admin/" redirectType="Permanent" /> </rule> <!-- wordpress rule 4,Unable to jump HTTP to HTTPS after opening. --> <rule name="wordpress rule 4" stopProcessing="true"> <match url="^" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" /> <!-- this addition prohibits access to a directory https://webkv.com/web such an empty link. at the same time, after modifying the https://webkv.com/wp-admin/options-permalink.php links, the front and back links of the entire website are invalid, resulting in the page can only open the home page, and the removal of this link will restore. because the same name directory exists in the website root directory, for example: (web|home|net|images|static). in this case, the use of static caching plug-ins such as wp rocket and wp super cache will lead to frequent chinese scrambling. --> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" /> </conditions> <action type="None" /> </rule> <rule name="wordpress rule 5" stopProcessing="true"> <match url="^(wp-(content|admin|includes).*)" ignoreCase="false" /> <action type="Rewrite" url="{R:1}" /> </rule> <rule name="wordpress rule 6" stopProcessing="true"> <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" /> <action type="Rewrite" url="{R:2}" /> </rule> <rule name="wordpress rule 7" stopProcessing="true"> <match url="." ignoreCase="false" /> <action type="Rewrite" url="index.php" /> </rule> <rule name="wordpress main rule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> <!-- wordpress chinese tag|category url 404 rule, wordpress includes php file for web.config modules --> <rule name="cnUrl" stopProcessing="true"> <match url="^(tag|category)/(.*)$" /> <action type="Rewrite" url="wp-content/plugins/my-custom-function-plugins/includes/plugins/cnurl/cnurl.php" /> </rule> <rule name="wordpress" patternSyntax="Wildcard"> <match url="*" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> <!-- END wordpress rule --> <!-- END wordpress --> |
//wp super cache缓存插件iis10 web.config规则,这个可以运行在iis7.5及以上,之前的文章介绍过功能,这类规则很少出现,因为之前根本米人写这个。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | <!-- BEGIN wp_super_cache --> <rule name="WP_Super_Cache_HTTPS_mobile_gzip" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author|wordpress_logged_in|wp-postpass)_.*$" negate="true" /> <add input="{HTTP_X_WAP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_USER_AGENT}" pattern="^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800|w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).*" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" /> <add input="{HTTPS}" pattern="on" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https-mobile.html.gz" matchType="IsFile" /> </conditions> <serverVariables> <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" /> <set name="HTTP_ACCEPT_ENCODING" value="" /> </serverVariables> <action type="Rewrite" url="/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https-mobile.html.gz" /> </rule> <!-- ssl in wordpress: how to move your wordpress site to https? the definitive guide --> <rule name="WP_Super_Cache_HTTPS_mobile" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add input="{HTTP_X_WAP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_PROFILE}" pattern="^[a-z0-9\"]+" /> <add input="{HTTP_USER_AGENT}" pattern="^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800|w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).*" /> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" negate="true" /> <add input="{HTTPS}" pattern="on" /> <add input="{DOCUMENT_ROOT}/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https-mobile.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="/wp-content/cache/supercache/{SERVER_NAME}/{R:1}/index-https-mobile.html" /> </rule> <rule name="WP_Super_Cache_HTTPS_gzip" stopProcessing="true"> <match url="^(.*)" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^(.*)$" /> <add input="{URL}" pattern="^/wp-admin/.*" negate="true" /> <add input="{REQUEST_METHOD}" pattern="POST" negate="true" /> <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" /> <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$" negate="true" /> <add |