最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

web.config(IIS)和.htaccess(Apache)配置

 更新時(shí)間:2019年11月03日 23:53:40   作者:風(fēng)靈使  
這些是我發(fā)現(xiàn)最有用的片段,/隨時(shí)間推移使用最多的片段。 他們處理諸如從查詢字符串,CORS標(biāo)頭重寫URL以及強(qiáng)制HTTPS重定向之類的事情

xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<system.webServer>

		<httpProtocol>
			<customHeaders>
				<add name="Access-Control-Allow-Origin" value="URL_TO_ALLOW"/>
				<add name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE,OPTIONS"/>
				<add name="Access-Control-Allow-Headers" value="Content-Type"/>
			</customHeaders>
		</httpProtocol>

</system.webServer>
</configuration>

forceHTTPS

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<system.webServer>

		<rewrite>
			<rules>

			<rule name="Force HTTPS" stopProcessing="true">
  		<match url="(.*)" />
  		<conditions logicalGrouping="MatchAll">
    	<add input="{HTTPS}" pattern="off" ignoreCase="true" />
    	<add input="{REQUEST_URI}" negate="true" pattern="/ADD_PATTERM_TO_EXCLUDE_FILES_OR_FOLDERS/" ignoreCase="true" />
  		</conditions>
  		<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
			</rule>

			</rules>
		</rewrite>

</system.webServer>
</configuration>

browserCaching

# Enables browser caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>

customErrorPages

# Sets up custom error pages for 4xx and 5xx errors
ErrorDocument 403 /custom-403.html
ErrorDocument 404 /custom-404.html

forceHTTPS

RewriteEngine On
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

preventAccessToConfigFiles

# Denies access to all .htaccess files
<Files ~ "^.*\.([Hh][Tt][Aa])">
Order Allow,Deny
Deny from all
Satisfy all
</Files>

urlRewrite

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

好了這篇文章就介紹到這了,需要的朋友可以學(xué)習(xí)一下。

相關(guān)文章

最新評(píng)論

开封县| 湘潭县| 浦城县| 廉江市| 中阳县| 会昌县| 四会市| 菏泽市| 中阳县| 沅陵县| 巩义市| 青铜峡市| 无锡市| 涞水县| 施秉县| 吴桥县| 新竹县| 随州市| 桐城市| 精河县| 汝州市| 股票| 金阳县| 邛崃市| 汉沽区| 陆川县| 行唐县| 天台县| 镇江市| 襄城县| 大埔县| 淮滨县| 南通市| 宕昌县| 乌兰浩特市| 黎川县| 枣强县| 晋江市| 离岛区| 治县。| 乐昌市|