校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > web.config(IIS)和.htaccess(Apache)配置

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

熱門標簽:北海市地圖標注app 湖北ai智能電銷機器人 AI電銷機器人 源碼 新科美甲店地圖標注 外呼系統打哪顯哪 新邵電銷機器人企業 蘭州ai電銷機器人招商 高德地圖標注論壇 江西外呼系統

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]

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

標簽:池州 南陽 大理 黔東 自貢 阿克蘇 黃石 海南

巨人網絡通訊聲明:本文標題《web.config(IIS)和.htaccess(Apache)配置》,本文關鍵詞  web.config,IIS,和,.htaccess,Apache,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《web.config(IIS)和.htaccess(Apache)配置》相關的同類信息!
  • 本頁收集關于web.config(IIS)和.htaccess(Apache)配置的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 屯昌县| 龙口市| 个旧市| 澎湖县| 凤阳县| 花莲市| 海兴县| 英超| 涞源县| 临泉县| 馆陶县| 清徐县| 锡林郭勒盟| 门源| 喀什市| 永宁县| 威远县| 汉寿县| 凌云县| 常州市| 丹棱县| 衢州市| 会同县| 房山区| 苏尼特左旗| 张家港市| 徐汇区| 海盐县| 通辽市| 娄底市| 彭州市| 梁平县| 绥德县| 天长市| 拉孜县| 隆安县| 保靖县| 鹤山市| 柘城县| 龙江县| 金溪县|