nginx伪静态配置
if ($uri !~ "^/manage\.php"){ set $rule_0 1$rule_0; } if (!-f $request_filename){ set $rule_0 2$rule_0; } if (!-d $request_filename){ set $rule_0 3$rule_0; } if ($rule_0 = "321"){ rewrite ^/(.*)$ /index.php/$1 last; }
我的web.config
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="蜘蛛反弹" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_USER_AGENT}" pattern="PetalBot" /> <add input="{HTTP_USER_AGENT}" pattern="Bytespider" /> <add input="{HTTP_USER_AGENT}" pattern="YisouSpider" /> <add input="{HTTP_USER_AGENT}" pattern="Yahoo\!\ Slurp" /> <add input="{HTTP_USER_AGENT}" pattern="EtaoSpider" /> <add input="{HTTP_USER_AGENT}" pattern="Applebot" /> <add input="{HTTP_USER_AGENT}" pattern="EasouSpider" /> <add input="{HTTP_USER_AGENT}" pattern="ia_archiver" /> <add input="{HTTP_USER_AGENT}" pattern="DoCoMo\ Spider" /> <add input="{HTTP_USER_AGENT}" pattern="DotBot" /> <add input="{HTTP_USER_AGENT}" pattern="AhrefsBot" /> <add input="{HTTP_USER_AGENT}" pattern="BDCbot" /> <add input="{HTTP_USER_AGENT}" pattern="DeuSu" /> <add input="{HTTP_USER_AGENT}" pattern="MJ12bot" /> <add input="{HTTP_USER_AGENT}" pattern="SEOkicks" /> <add input="{HTTP_USER_AGENT}" pattern="YandexBot" /> <add input="{HTTP_USER_AGENT}" pattern="DomainCrawler" /> <add input="{HTTP_USER_AGENT}" pattern="Qwantify" /> <add input="{HTTP_USER_AGENT}" pattern="seznambot" /> <add input="{HTTP_USER_AGENT}" pattern="BUbiNG" /> <add input="{HTTP_USER_AGENT}" pattern="aiHitBot" /> <add input="{HTTP_USER_AGENT}" pattern="SiteExplorer" /> <add input="{HTTP_USER_AGENT}" pattern="ExtLinksBot" /> <add input="{HTTP_USER_AGENT}" pattern="spbot" /> <add input="{HTTP_USER_AGENT}" pattern="netEstate\ NE\ Crawler" /> <add input="{HTTP_USER_AGENT}" pattern="AlphaBot" /> <add input="{HTTP_USER_AGENT}" pattern="MegaIndex\.ru" /> <add input="{HTTP_USER_AGENT}" pattern="MauiBot" /> <add input="{HTTP_USER_AGENT}" pattern="Daum" /> <add input="{HTTP_USER_AGENT}" pattern="YaK\/1\.0" /> <add input="{HTTP_USER_AGENT}" pattern="BLEXBot" /> <add input="{HTTP_USER_AGENT}" pattern="SemrushBot" /> <add input="{HTTP_USER_AGENT}" pattern="serpstatbot" /> <add input="{HTTP_USER_AGENT}" pattern="Nimbostratus-Bot" /> <add input="{HTTP_USER_AGENT}" pattern="Adsbot" /> <add input="{HTTP_USER_AGENT}" pattern="vxiaotou-spider" /> <add input="{HTTP_USER_AGENT}" pattern="CensysInspect" /> <add input="{HTTP_USER_AGENT}" pattern="Barkrowler" /> <add input="{HTTP_USER_AGENT}" pattern="DataForSeoBot" /> <add input="{HTTP_USER_AGENT}" pattern="SeekportBot" /> <add input="{HTTP_USER_AGENT}" pattern="coccocbot" /> <add input="{HTTP_USER_AGENT}" pattern="Neevabot" /> <add input="{HTTP_USER_AGENT}" pattern="t3versionsBot" /> <add input="{HTTP_USER_AGENT}" pattern="YaoSouBot" /> </conditions> <action type="Redirect" url="http://{REMOTE_ADDR}/{R:1}" redirectType="Found" /> </rule> <rule name="已导入的规则 2" 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" /> <add input="{R:1}" pattern="\.(hqx|cpt|csv|bin|dms|lha|lzh|exe|class|psd|so|sea|dll|oda|pdf|ai|eps|ps|smi|smil|mif|xls|ppt|pptx|wbxml|wmlc|dcr|dir|dxr|dvi|gtar|gz|gzip|php4|php3|phtml|phps|js|swf|sit|tar|tgz|z|xhtml|xht|zip|rar|mid|midi|mpga|mp2|mp3|aif|aiff|aifc|ram|rm|rpm|ra|rv|wav|bmp|gif|jpeg|jpg|jpe|jp2|j2k|jpf|jpg2|jpx|jpm|mj2|mjp2|png|tiff|tif|heic|heif|css|htm|shtml|txt|text|log|rtx|rtf|xml|xsl|mpeg|mpg|mpe|qt|mov|avi|movie|doc|docx|dot|dotx|xlsx|word|xl|eml|json|pem|p10|p12|p7a|p7c|p7m|p7r|p7s|crt|crl|der|kdb|pgp|gpg|sst|csr|rsa|cer|3g2|3gp|mp4|m4a|f4v|flv|webm|aac|m4u|m3u|xspf|vlc|wmv|au|ac3|flac|ogg|kmz|kml|ics|ical|zsh|7z|7zip|cdr|wma|jar|svg|vcf|srt|vtt|ico|odc|otc|odf|otf|odg|otg|odi|oti|odp|otp|ods|ots|odt|odm|ott|oth)$" negate="true" /> </conditions> <action type="Rewrite" url="index.php/{R:1}" /> </rule> </rules> <outboundRules> <rule name="AddCrossDomain"> <match serverVariable="RESPONSE_Access_Control_Allow_Origin" pattern=".*" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> <add input="{HTTP_ORIGIN}" pattern="(https?://((www\.)?abc\.com|(www\.)?abc\.cn))" /> </conditions> <action type="Rewrite" value="{C:0}" /> </rule> </outboundRules> </rewrite> </system.webServer> </configuration>
最后部分是允许跨站设置