<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                [TOC] ## .htaccess中配置的場景 ### 自定義錯誤頁面 在`.htaccess` 中 ``` ErrorDocument 404 /404.html ErrorDocument 500 /500.htm ``` ### 限制迅雷 通過特征分析,限制迅雷訪問 ``` RewriteCond %{HTTP_USER_AGENT} 2.0.50727 [NC,OR] --如果是迅雷在HTTP_USER_AGNET中就有2.0.50727 RewrtieCond %{HTTP_USER_AGENT} ^BlackWido ^BlackWido [NC,OR] RewriteRule . /demo.txt ``` ### 防盜鏈 不顯示圖片 ``` RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.demo.com/.*$ [NC] RewriteRule \.(gif|jpg|png)$ –[F,NC] ``` 顯示禁止的圖片 ``` RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.demo.com/.*$ [NC] RewriteRule \.(gif|jpg|png)$ localhost/demo/2.jpg [R] ``` ### 帶post 的參數轉發到其他域名 > [參數](https://blog.csdn.net/mengzuchao/article/details/80593789) 可在`.htaccess` 中配置 `RewriteRule ^(Api/User/get_dept_id)$ http://192.168.0.123:82/$1 [L,R=301,P]` 并且加載 `http.conf`的兩個模塊 ``` LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so ``` ### 重定向指定url 開啟 `mod_proxy.so`與`mod_proxy_http.so` ``` ProxyPass /imapp/depts http://127.0.0.1:8081/imapp/depts ProxyPass /api/dept/op_record http://127.0.0.1:8081/api/dept/op_record ``` ### URL所有重定向 ``` RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] ``` //可添加判斷,是否開啟重寫模塊 ``` <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule> ``` ### 永久 /臨時 重定向 301-永久重定向 302-臨時重定向 ``` Redirect permanent index.php home.php #永久重定向 Redirect temp index.php home.php #臨時重定向 ``` ### 重定向移動設備 ``` RewriteEngine On RewriteCond %{REQUEST_URI} !^/m/.*$ RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC] #------------- The line below excludes the iPad RewriteCond %{HTTP_USER_AGENT} !^.*iPad.*$ #------------- RewriteCond %{HTTP_USER_AGENT} !macintosh [NC] #*SEE NOTE BELOW RewriteRule ^(.*)$ /m/ [L,R=302] ``` ### 強制瀏覽器下載指定的文件類型 你可以強制瀏覽器下載某些類型的文件,而不是讀取并打開這些文件,例如MP3、XLS。 ``` <Files *.xls> ForceType application/octet-stream Header set Content-Disposition attachment </Files> <Files *.eps> ForceType application/octet-stream Header set Content-Disposition attachment </Files> ``` ### 使用.htaccess緩存 給網站提速 調試時谷歌瀏覽器需要關閉緩存開關 ``` # 1 YEAR <FilesMatch "\.(ico|pdf|flv)$"> Header set Cache-Control "max-age=29030400, public" </FilesMatch> # 1 WEEK <FilesMatch "\.(jpg|jpeg|png|gif|swf)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> # 2 DAYS <FilesMatch "\.(xml|txt|css|js)$"> Header set Cache-Control "max-age=172800, proxy-revalidate" </FilesMatch> # 1 MIN <FilesMatch "\.(html|htm|php)$"> Header set Cache-Control "max-age=60, private, proxy-revalidate" </FilesMatch> ``` ### 404頁面跳轉,跳轉到404.php,根據url記錄不存在頁面的路徑 ``` <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} .wp-comments-post\.php* RewriteCond %{HTTP_REFERER} !.*yourdomainname.* [OR] RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L] </IfModule> ``` ### 只允許 get,post 請求 apache 2.4版本 中 ``` <LimitExcept GET POST> Require all denied </LimitExcept> ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看