国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > IIS > 正文

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

2024-08-29 03:09:07
字體:
來源:轉載
供稿:網友

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 OnExpiresByType 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]

好了這篇文章就介紹到這了,需要的朋友可以學習一下。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 信宜市| 河津市| 太原市| 西藏| 措勤县| 繁峙县| 嘉兴市| 海原县| 邹城市| 武平县| 炎陵县| 永年县| 榆中县| 英超| 罗山县| 迭部县| 灵武市| 宣武区| 图木舒克市| 鄂温| 福海县| 张掖市| 许昌市| 沙雅县| 黑水县| 陇南市| 攀枝花市| 耿马| 黄龙县| 望谟县| 镇宁| 武宣县| 康马县| 堆龙德庆县| 临西县| 舟曲县| 尤溪县| 石柱| 集安市| 大悟县| 江安县|