[問題] htaccess如何設定轉址例外?

看板Web_Design作者 (haidai)時間8年前 (2017/04/21 09:18), 8年前編輯推噓0(008)
留言8則, 4人參與, 最新討論串1/1
我把網站的所有404通通轉去404.html 但是現在發生了連sitemap都被轉走 現在Google抓不到我的sitemap 想問如果設定404一律轉址的話 如何設定例外? -- ◢◣ ◢◣ ◎每月29日天使節 \(≧▽≦)/ ◤◥ ◎當天呼叫平時就保持聯絡的小天使 ◎點歌給小天使並發表於AngelPray████▆ ◎小天使就會下P幣雨喔 ( ̄▽ ̄)> " \|/ \|/ \|/ \|/ \|/ \|/ \|/ =█◣`█◣=█◣"█◣`█◣"█◣"█◣ ︴ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.82.33.143 ※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1492737525.A.B0D.html

04/21 18:46, , 1F
sitemap也404?
04/21 18:46, 1F

04/21 19:03, , 2F
對啊,感覺不是html或是圖檔就會被轉走
04/21 19:03, 2F

04/21 19:03, , 3F
之前測試OK的sitemap更新之後也404了
04/21 19:03, 3F

04/23 12:01, , 4F
你自己怎麼寫也沒貼是要怎麼幫你debug....這不是靠感覺的
04/23 12:01, 4F
抱歉,我以為大家基本上都用同一段code <files .htaccess> order allow,deny deny from all </files> # use PHP4 as default #AddHandler application/x-httpd-php4 .php <IfModule mod_rewrite.c> RewriteEngine On ErrorDocument 404 /404.html </IfModule> 我是這樣寫

04/25 19:13, , 5F
deny from all ...
04/25 19:13, 5F

04/25 19:14, , 6F
不對, 你這個要看 apache log 啊, 你要看他為什麼拒絕
04/25 19:14, 6F

04/25 19:16, , 7F
而且你有 ErrorDocument , 不需要用 rewrite
04/25 19:16, 7F

04/25 19:22, , 8F
RewriteEngine 我去查參數只有 on/off, 你這哪抄來的...
04/25 19:22, 8F
我忘記分行 If前面是本來就有的我沒去更改 後面 <IfModule 開始是這邊找的 http://www.vixual.net/blog/archives/247 ※ 編輯: haidai (125.230.74.154), 04/25/2017 20:38:54
文章代碼(AID): #1O-LtriD (Web_Design)
文章代碼(AID): #1O-LtriD (Web_Design)