iT邦幫忙

1

網址指向

不明 2016-01-04 02:28:173473 瀏覽
  • 分享至 

  • xImage

301指向如何讓進入www.myurl.com/data、myurl.com/data、www.myurl.com/data/index.php、myurl.com/data/index.php全都指向myurl.com

但是,不要將data資料夾以下內容都指過去
也就是說,輸入myurl.com/data會指向myurl.com
但是"不等於"
輸入myurl.com/data/aaa.php會指向myurl.com/aaa.php
我只是要那些名字轉過去,而不是內容物全轉過去..
謝謝

ayu iT邦好手 2 級 ‧ 2016-01-04 03:52:42 檢舉
您可survey一下 301 url rewrite
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

4
wiseguy
iT邦超人 1 級 ‧ 2016-01-04 09:42:48

這哪需要用轉向?不就把你的 document root 設到 data 目錄就好了咩,頂多再把 myurl.com 加個 alias 別名 www.myurl.com

0
wwx
iT邦好手 1 級 ‧ 2016-01-05 11:45:42

這個需求是否考慮改用404導向 myurl.com
而 myurl.com/data 等同會找 myurl.com/data/index.php
所以把 index.php 砍了即會回應 404
不然就是 index.php 內容另外寫成導向 myurl.com 就可以了

我要發表回答

立即登入回答