Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Kupası
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPress’te 404 Sayfanızı Ana Sayfaya Yönlendirme

Editoryal Not: WPBeginner üzerindeki ortak bağlantılardan komisyon kazanıyoruz. Komisyonlar, editörlerimizin görüşlerini veya değerlendirmelerini etkilemez. Editoryal Süreç hakkında daha fazla bilgi edinin.

WordPress’te 404 sayfanızı ana sayfanıza yönlendirmek mi istiyorsunuz?

404 ‘Bulunamadı’ sayfasını web sitenizin ana sayfasına yönlendirmek, hemen çıkma oranınızı azaltmaya yardımcı olabilir ve kullanıcılarınızın web sitenizdeki diğer yararlı içerikleri keşfetmelerini sağlayabilir.

Bu makalede, WordPress’te 404 sayfanızı ana sayfanıza nasıl yönlendireceğinizi göstereceğiz.

How to Redirect Your 404 Page to the Home Page in WordPress

Neden 404 Sayfanızı WordPress Ana Sayfanıza Yönlendirmelisiniz?

Bir kullanıcı WordPress web sitenizde mevcut olmayan bir sayfayı ziyaret etmeye çalıştığında, WordPress ona 404 hata sayfası gösterecektir.

Bu sayfanın ifadesi ve görünümü, kullandığınız temaya bağlı olarak değişebilir.

Default WordPress 404 page

Varsayılan 404 sayfasına gelen çoğu kullanıcı sitenizi hızla terk edecektir. Bu, genel hemen çıkma oranınızı artırabilir ve arama motoru sıralamalarınızı olumsuz etkileyebilir.

Bu yüzden özel bir 404 sayfası oluşturmak için zaman ayırmalısınız. Ancak bunu yapana kadar, bu eğitimdeki kısayolu kullanabilir ve kullanıcıları ana sayfaya yönlendirebilirsiniz.

Mükemmel bir dünyada, belirli 404 hata isteklerini de en alakalı sayfalara yönlendirirsiniz.

Bununla birlikte, tüm 404 hatalarını ana sayfanıza nasıl yönlendireceğinize bakalım. İki yöntemi ele alacağız ve ayrıca tek tek sayfalar için nasıl özel yönlendirmeler oluşturacağınızı göstereceğiz:

Yöntem 1: WordPress’te Tüm 404 Hatalarını Ana Sayfaya Yönlendirin

Bu yöntem için All in One SEO for WordPress (AIOSEO) kullanacağız. Yönlendirmeleri ayarlamanıza, içeriğinizi arama motorları için optimize etmenize ve daha fazlasına olanak tanıyan en iyi WordPress SEO eklentisidir.

Yapmanız gereken ilk şey All in One SEO’yu (AIOSEO) yüklemek ve etkinleştirmektir. Daha fazla ayrıntı için bir WordPress eklentisinin nasıl kurulacağına ilişkin adım adım kılavuzumuza bakın.

Not: All in One SEO’nun ücretsiz bir sürümü var, ancak Redirect bir Pro eklentisi olduğu için Pro sürümünü kullanacağız.

Eklenti etkinleştirildikten sonra, All in One SEO ” Yönlendirmeler bölümüne gitmeniz gerekir.

Yönlendirmeleri henüz ayarlamadıysanız, ‘Yönlendirmeleri Etkinleştir’ düğmesine tıklamanız gerekir.

Activating Redirects in All in One SEO

Bu, All in One SEO’nun Yönlendirmeler modülünü yükleyecektir.

Ardından, sayfanın üst kısmındaki ‘Ayarlar’ sekmesine tıklamanız gerekecektir. Bu sayfa AIOSEO’da yönlendirmeleri yapılandırmanıza olanak tanır.

The AIOSEO Redirects Settings Page

‘Gelişmiş 404 Ayarları’ bölümünü bulana kadar sayfayı aşağı kaydırmanız gerekir. Maviye dönmesi için geçiş düğmesine tıklayarak bu bölümü etkinleştirin.

Şimdi biraz daha ayar görebileceksiniz. ‘Varsayılan 404 yönlendirmesini etkinleştir’ düğmesini açık konuma getirmelisiniz. Bundan sonra, ‘Ana Sayfa’ seçeneğinin seçili olduğundan emin olun.

Enabling Default 404 Redirect in AIOSEO

Ayrıca bir ‘Özel URL’ seçeneği olduğuna dikkat edin. Bu, 404 hatalarını herhangi bir gönderi veya sayfaya yönlendirmenize olanak tanır. Ayarlarınızı saklamak için sayfanın üst veya alt kısmındaki ‘Değişiklikleri Kaydet’ düğmesine tıklamayı unutmayın.

Artık ziyaretçileriniz web sitenizde var olmayan bir URL’yi ziyaret etmeye çalıştıklarında, varsayılan 404 sayfasını görmek yerine ana sayfaya yönlendirilecekler.

Yöntem 2: Kod Kullanarak Tüm 404 Hatalarını Ana Sayfaya Yönlendirin

Bir eklenti kullanmayı tercih etmiyorsanız, tüm 404 sayfalarını ana sayfaya yönlendirmek için basit bir kod parçacığı kullanabilirsiniz.

Bu yöntemde WordPress dosyalarınıza kod eklemeniz gerekir. Bunu daha önce yapmadıysanız, web’den WordPress’e kod parçacıkları yapıştırmaya ilişkin başlangıç kılavuzumuza bakın. WordPress tema şablonu hiyerarşisi kılavuzumuzu da görmek isteyebilirsiniz.

Öncelikle, WordPress tema klasörünüzde yeni bir dosya oluşturmanız ve 404.php olarak adlandırmanız gerekecektir. Temanızda zaten bir 404.php dosyası varsa, bunun yerine o dosyayı düzenlemeniz gerekir.

Bu dosyayı düzenlemek için WordPress hosting hesabınıza bir FTP istemcisi veya dosya yöneticisi aracı ile bağlanmanız gerekir.

FTP 404 php file

Web sitenize bağlandığınızda, WordPress temalar klasörünüzde 404.php dosyasını görebileceksiniz.

Aşağıdaki kodu 404.php dosyanıza ilk satır olarak eklemeniz gerekmektedir:

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));
exit();
?>

Ardından, 404.php dosyasını kaydedin ve FTP veya barındırma kontrol panelinizi kullanarak tema dizininize yeniden yükleyin.

Artık bir sayfa bulunamadığında, ziyaretçiler 404 sayfasını görmek yerine WordPress ana sayfanıza yönlendirilecekler.

Bonus: AIOSEO ile Özel 404 Sayfa Yönlendirmeleri Kurun

404 hatalarını ele almanın en iyi ve en SEO dostu yolu, ziyaretçileri yalnızca ana sayfanıza değil, en alakalı sayfaya yönlendirmektir.

All in One SEO eklentisinin Yönlendirmeler özelliği de tüm 404 sayfa hatalarını takip edebilir ve WordPress’te akıllı 404 sayfa yönlendirmeleri ayarlamanıza olanak tanır.

Yöntem 1’i izlediğinizde AIOSEO ‘yu yükleyip etkinleştirdiyseniz, tek yapmanız gereken All in One SEO ” Yönlendirmeler sayfasına geri dönmek ve ‘Ayarlar’ sekmesine tıklamaktır.

Ardından, ‘Günlükler’ bölümünü görene kadar aşağı kaydırın. 404 günlükleriniz, ziyaretçilerinizin sitenizde artık mevcut olmayan sayfaları ziyaret etmek için kullanmaya çalıştıkları URL’lerin bir kaydıdır.

Mavi görünmesi için ‘404 Günlükleri’nin açık olduğundan emin olun. Açılır menüden zaman aralığını seçerek eklentinin günlüklerinizi ne kadar süreyle kaydetmesini istediğinizi de seçebilirsiniz.

Enable 404 logs

Devam etmeden önce ‘Değişiklikleri Kaydet’e tıklamayı unutmayın.

Bundan sonra, son erişilen 404 sayfasını görmek için ‘404 Günlükleri’ menü seçeneğine tıklayabilirsiniz.

Unutmayın, günlüğe kaydetmeyi yeni etkinleştirdiğiniz için hemen hiçbir şey göstermeyebilir. Herhangi bir yararlı bilgi görmeden önce 24 saate kadar beklemeniz gerekebilir.

Click 404 logs menu option

‘URL’ sütunu size kullanıcıların ziyaret etmeye çalıştığı ancak mevcut olmayan sayfaları gösterecektir.

Bu URL’lerden herhangi birini ‘Yönlendirme’ sütunundaki ‘Yönlendirme Ekle’ bağlantısına tıklayarak mevcut bir sayfaya yönlendirebilirsiniz. Bu, yönlendirme bilgilerinizi girebileceğiniz bir açılır menü açacaktır.

En iyi sonuçlar için, ‘Hedef URL’ kutusuna orijinal sorgu için en alakalı sayfayı girmeniz ve ardından ‘Yönlendirme Ekle’yi tıklamanız gerekir.

Add home page redirect

Örneğin, bir WordPress blogunun nasıl başlatılacağına ilişkin bir öğreticiyi sildiyseniz ve ardından yeni bir tane yazdıysanız, eski URL’yi ana sayfanız yerine yeni blog gönderisine yönlendirmek en iyisidir.

Birden fazla 404 sayfası yönlendirmesi eklemek için yukarıdaki adımların aynısını uygulamanız yeterlidir.

Unutmayın, genellikle 404 sayfanızı sonsuza kadar ana sayfanıza yönlendirmek istemezsiniz. Daha iyi dönüşüm sağlayacak özel bir 404 sayfası tasarımı oluşturana veya kullanıcıları var olan ilgili bir sayfaya yönlendiren ayrı yönlendirmeler ayarlayana kadar bu harika bir geçici çözümdür.

WordPress’te 404 Hataları Hakkında Uzman Kılavuzları

Artık WordPress’te 404 sayfanızı ana sayfanıza nasıl yönlendireceğinizi bildiğinize göre, 404 hatalarının nasıl ele alınacağıyla ilgili diğer bazı kılavuzları görmek isteyebilirsiniz.

Umarız bu makale WordPress’te 404 sayfanızı nasıl yeniden yönlendireceğinizi öğrenmenize yardımcı olmuştur. Ayrıca nihai WordPress SEO kılavuzumuzu ve özel 404 sayfaları oluşturmak için en iyi sürükle ve bırak WordPress sayfa oluşturucularını görmek isteyebilirsiniz.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Açıklama: İçeriğimiz okuyucu desteklidir. Bu, bazı bağlantılarımıza tıklarsanız komisyon kazanabileceğimiz anlamına gelir. WPBeginner'ın nasıl finanse edildiğini, neden önemli olduğunu ve nasıl destek olabileceğinizi görün. İşte editoryal sürecimiz.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Ultimate WordPress Araç Kiti

Araç setimize ÜCRETSİZ erişim sağlayın - her profesyonelin sahip olması gereken WordPress ile ilgili ürün ve kaynaklardan oluşan bir koleksiyon!

Reader Interactions

66 yorumBir Cevap Bırakın

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Ralph says

    I have 2 or 3 blog posts that had to be deleted, but the urls are still present on Pinterest, forums, etc., so I redirected 404 to my homepage in hosting settings to not lose traffic. However, for any other non deleted 404 I have my own “sorry” info and search bar.
    I really appreciate good 404s on people’s websites, as this often indicates that they really care. Redirecting to the homepage has its uses, but not every time I think.

  3. Jiří Vaněk says

    I think, but it’s just my personal opinion, that redirecting people to the homepage isn’t good. Instead, it’s better to create a humorous 404 with an apology that reduces visitor frustration and offers interesting content in the form of a 404 page where the latest content of the website or blog can be automatically inserted. This way, the visitor realizes the page no longer exists but also gets the opportunity to laugh at a well-crafted 404 page and receives alternative content as an option for what to do next.

    • WPBeginner Support says

      That is another option, it depends on the site and what type of content but both are valid options :)

      Yönetici

  4. Mbah Chinedu says

    Hello, the 301 redirect you do at php file in ftp, can’t I use a text to inform user that the page is going to redirect in some seconds and then allow it redirect. At least bounce rate still reduces, because google has no issue with soft 404 or 404 pages

    • WPBeginner Support says

      You can create a page like that if you wanted but we do not have a beginner-friendly method for creating that with PHP.

      Yönetici

  5. Mudassir says

    Hello WPbeginner team,

    I am using Astra Pro and have already some code in my 404.php. Now my question is, where do I add the above code exactly? Should I remove all that existing code and add yours or how?

    Please help!

  6. Noble A. Ozogbuda says

    Hello please how can i modify this code to redirect all my 404s pages to a specific page, not homepage?

  7. Mohan says

    I have just installed it and did some redirection. I hope it works the way I expect. Anyway, its a nice plugin. Thanks for the helpful post about it.

  8. Jitendra Mahato says

    hi… i want to know that how to redirect the 404 page to a custom page.I want to do that in my blog. Thank you. Hoping your answer. I used this code and doing well.

  9. Drake Bliss says

    If you only want to redirect a specific url path, try this code below. First create a child theme if you do not have one and move 404.php to the the child theme.

    Edit the 404.php page in the child theme and paste this code into the very top of the 404.php page. You can insert more check for other paths you want to redirect,.

  10. yudi cahyadi says

    hi there…i’m using chid theme but it doesn’t exist 404 file,, how to creat 404.php file using child theme not in main theme to insert code ..

    thank you..

  11. Liem Hoang says

    Work perfectly! Thank admin so much, you have been saved my life. My website will no longer get error win WMT.

  12. Malindo My Id says

    wow thankyou so much,, did you know thats my site have been redirect from spammer, makes my eror page 404 found until 1240 not found url. and now I was redirect to my home age.. you are good boys.. thankyou.. I like this page,, so useful for many blogger ..

    Malindo My Id from Indonesia

  13. Sid says

    Is there any way that I can redirect specific 404 pages. Like I created a custom post type and I just want to redirect 404 pages on that post type. Will that be possible?

  14. Kumar says

    This code is causing problem, when i post something new permalink gets shorten and does not contain complete post title.

    What shld i do?

  15. Miguel Guzman says

    I have 1,500 404’s that is because i started using dates on the url at the beginning when i started using WordPress. I changed the permalinks and that’s when the 404 started. is really hard when you have so many redirect to map them individually. its easier to re direct then all to home page.

  16. Riccardo says

    How can you redirect depending on the language the site is displaying?
    My website is in french and english, but when I use your code it goes only to one page for both languages.

    Thank you for your help!

    Riccardo

  17. slango20 says

    this is bad practice, very bad. If you have time to set up a wordpress site, you have time to put 404 Not Found into a 404.php at *least* instead of redirecting to the homepage with no explanation whatsoever

  18. P.D. says

    Does anyone know if the code works as well for multisite installations?

    If so, does the 404 page bounce to the subdomain / subfolder / subsite or the main or root domain / folder / site?

    • slango20 says

      those crawl “errors” are perfectly normal and don’t affect your site’s ranking, just like it’s not a good idea to reply to all sms with the same response just because you received a few spam sms

  19. Filip Hajek says

    There is a cool WP plugin “404 Redirected”, whoch captures 404s for you and let’s you redirect them easily.

    • Eric says

      Thanks for the comment! That helped me out a lot! The article’s has a good solution too but I don’t like messing with my code. Thanks again for the suggestion Flip!

      -Eric Out-

  20. Rakesh says

    It rocks!!! I used the code ( previously my theme given me a custom 404 page template, but I replaced with your few lines). Thank you.

  21. Julien says

    I am really not convinced by the relevance of this. 404 means the page doesn’t exist anymore, 301 is a permanent redirect. Those 2 errors do not mean the same for search engines.

    • Rootpak says

      I agree. I would not recommend redirecting all 404 pages to the home page. From SEO point of view it is not accepyable. It means that every not existing page was moved to home page. It can simply lead to problems how google sees your site.

  22. Andy Feliciotti says

    I use smart 404 extension and I must say it’s amazing, it’ll find a post with a similar URL and redirect to it

  23. Clark Wimberly says

    I should know better, but one time I created an infinite loop using something close to this. It was a site with few pages for mostly logged-in users, so I made my 404 template redirect to the user page. What I had forgotten is that I made my user page redirect to the 404 if you weren’t signed in. Totally my fault, and barely relevant, but there you go.

    • Editorial Staff says

      Hah that’s funny. The only reason why we wrote this code was for a small one-page site which where we didn’t want users to peek around too much. Some folks are just curious and they start running search or checking out feeds etc. So we disabled search, feeds, and redirected 404 to the homepage.

      Yönetici

Bir Cevap Bırakın

Yorum bırakmayı seçtiğiniz için teşekkür ederiz. Lütfen tüm yorumların yorum poli̇ti̇kasi uyarınca denetlendiğini ve e-posta adresinizin yayımlanmayacağını unutmayın. Ad alanında anahtar kelime KULLANMAYIN. Kişisel ve anlamlı bir sohbet edelim.