請重新導向到 www


瀏覽器會隱藏 www 子網域,www 子網域看起來會跟沒有 www 的根網域一模一樣。所以使用 www 子網域的時候應該要確保輸入根網域的時候也會重新導向到 www,才不會讓使用者輸入網址時不知道為何無法載入。

例如:架站服務 Netlify 預設指派 www 子網域給網站的時候會同時指派根網域。

If you assign an apex domain or a www subdomain to your site, Netlify will automatically add both the apex domain and the www subdomain.

https://docs.netlify.com/domains-https/custom-domains/configure-external-dns/

以下是有 www 子網域但是造訪根網域時會除錯的常用臺灣網站,依 Tranco 排行排序。

最近更新:2024-03-16T08:05:00.291Z

不輸入 www 會出錯的臺灣網站

這些網站有 www 子網域,瀏覽器上看起來像是沒有 www,但是照瀏覽器上所顯示的輸入時會出錯。

Tranco 排行 網站
#8333
#12787
#17178
#17464
#20579
#22309
#23693
#25408
#24568
#27019
#28140
#30091
#30278
#30670
#30438
#31586
#32692
#33726
#34376
#34776
#35283
#37701
#39186
#38736
#39884
#41484
#40999
#42621
#45012
#45722
#46257
#47962
#49083
#50503
#52549
#54405
#55175
#57438
#62234
#60788
#63144
#63825
#64311
#64730
#66224
#68039
#69269
#70744
#70895
#71786
#72154
#73092
#76233
#77115
#80923
#81163
#81518
#82108
#82402
#83274
#83647
#84288
#84818
#88259
#93069
#95887
#96571
#99005
#99054
#96043
#101262
#101359
#101200
#101872
#103999
#106453
#106597
#108122
#108980
#108915
#109130
#114713
#115088
#114213
#115479
#115975
#116439
#117007
#118393
#118425
#118817
#119811
#120109
#122505
#122536
#123694
#123652
#124925
#125239
#126221
#127547
#129873
#129997
#131565
#132055
#132147
#134559
#135544
#135675
#137260
#138054
#138926
#139146
#142828
#142620
#146242
#147282
#150427
#149798
#151629
#152164
#154276
#155426
#157667
#158258
#157951
#159775
#158870
#161372
#163062
#160990
#165325
#165865
#166558
#167280
#168013
#169850
#169077
#169991
#172594
#173234
#175091
#176046
#176505
#181374
#184630
#187198
#188717
#189085
#190792
#190848
#191329
#192120
#195552
#196453
#196659
#199550
#203215
#203715
#207157
#207660
#208349
#208987
#209582
#209409
#211078
#210511
#212657
#213437
#213927
#216853
#217342
#217887
#218974
#223295
#224981
#225165
#225043
#226920
#228150
#229583
#229995
#230738
#230547
#232776
#232976
#233681
#235876
#236322
#237100
#237662
#238691
#242069
#244032
#251812
#255219
#257287
#257702
#258518
#260785
#262201
#265244
#265410
#266383
#267555
#267072
#269978
#273157
#275654
#276490
#278203
#279273
#279498
#278032
#278233
#281111
#281097
#282528
#284576
#284799
#291249
#290586
#292672
#293232
#293607
#293163
#300368
#301051
#303190
#303498
#301638
#303848
#305687
#306357
#306253
#308014
#307177
#310527
#308575
#311978
#312720
#313495
#312861
#314350
#316405
#314395
#317714
#319163
#320590
#322793
#323488
#327938
#329615
#330244
#332609
#333344
#334031
#336170
#344046
#348457
#351454
#351672
#353870
#352236
#356899
#357659
#358134
#359895
#365481
#369067
#373243
#374894
#376058
#376492
#377246
#377909
#380623
#384256
#387751
#388771
#390363
#390774
#393880
#392682
#398058
#400322
#400917
#399582
#401880
#403456
#406242
#408518
#409274
#410784
#412398
#416301
#417659
#419886
#421845
#425290
#426168
#426281
#427018
#427972
#429269
#429686
#429675
#429927
#429996
#430509
#433023
#434404
#433723
#435143
#435903
#435517
#445305
#447478
#447672
#447839
#448714
#448326
#452379
#455719
#458475
#461166
#463835
#466116
#468744
#468998
#469650
#472967
#473548
#476742
#478536
#478801
#480996
#481406
#483657
#485014
#482313
#485271
#485684
#487486
#487231
#487601
#490385
#492412
#492959
#491489
#493494
#494464
#494182
#495559
#495983
#496743
#501558
#501215
#504971
#507800
#508028
#514574
#515795
#518244
#519159
#521881
#534625
#535860
#539272
#539595
#539634
#544041
#542311
#545723
#546337
#546779
#547976
#548412
#549677
#552481
#557293
#557812
#559553
#560800
#564265
#566382
#572103
#578631
#579627
#583760
#586907
#587361
#587407
#588300
#593281
#596082
#596227
#597568
#599060
#602675
#602896
#603252
#606778
#609724
#610255
#611309
#613479
#615877
#616237
#613931
#619524
#619859
#629656
#628139
#625891
#631390
#632156
#633751
#634264
#638620
#641207
#643922
#644243
#647183
#647310
#648258
#647136
#650575
#653316
#656782
#659092
#660536
#662385
#665239
#668554
#670181
#671372
#675029
#671549
#678461
#682325
#683822
#684119
#693825
#696084
#698854
#698891
#702301
#703138
#702924
#704880
#705409
#712067
#712723
#715017
#715989
#718055
#719564
#722720
#724539
#724273
#726293
#726321
#729120
#731835
#733620
#735147
#737519
#738078
#738430
#739286
#743174
#743649
#744387
#745990
#745531
#747150
#751212
#752139
#756665
#757106
#764895
#766379
#770888
#771599
#772193
#772273
#772633
#772840
#775495
#775550
#775851
#777621
#780599
#783820
#784471
#784836
#788042
#788545
#790642
#791326
#791748
#791329
#792314
#792717
#792939
#792821
#794659
#796406
#796583
#797744
#799173
#799069
#798559
#799679
#800629
#800630
#802157
#804079
#805563
#806583
#806242
#807293
#807528
#807530
#808087
#807992
#809306
#808751
#808755
#810275
#811277
#812104
#812651
#815464
#817318
#817531
#818989
#819328
#819463
#819577
#820871
#821949
#822862
#823287
#826451
#828876
#829590
#830433
#831897
#832324
#833058
#833094
#833133
#833057
#833885
#834423
#834417
#835273
#838771
#839150
#839041
#841042
#841576
#841610
#845763
#848471
#849274
#849068
#854611
#855881
#857784
#864946
#870365
#872862
#878513
#877817
#885902
#886884
#888332
#888426
#888673
#889056
#890734
#890777
#892113
#892544
#893079
#893914
#896040
#896964
#897006
#897925
#898715
#899000
#899547
#899715
#899918
#900226
#901102
#901329
#905894
#905780
#908428
#913850
#914418
#917795
#920340
#932190
#934605
#937837
#945158
#946903
#959243
#964258
#966768
#969450
#973830
#975958
#981134
#985412
#983139
#987346
#989387
#993208

同步根網域與 www 子網域的資源

Netlify 的 DNS 設定說明

Cloudflare 說明文件:DNS record types

GoDaddy 說明文件:新增 CNAME 記錄

若主要使用的網址是 www.example.com,要讓 example.com 重新導向到主網址:

  1. 如果 DNS 提供者像 Cloudflare 一樣支援 CNAME flattening,可以直接新增一個 CNAME 紀錄

    • 名稱為 @
    • 數值為 www.example.com

    CNAME 紀錄一般無法用於根網域,此時可以自行複製 www 子網域的 A 紀錄,例如 www 指向 0.0.0.0 時只要再建立一個 A 紀錄: 便會

    • 名稱為 @
    • 數值為(舉例)0.0.0.0

    造訪 example.com 時便會跟 www.example.com 時解析成同一個 IP 位址。

  2. 之後再從伺服器回傳 302 或 307 重新導向到主網址。


作:如月飛羽;設計參考 Why No HTTPS.

nowww@kisaragi-hiu.com

https://kisaragi-hiu.com