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 Subdomain’den Root Domain’e Nasıl Doğru Şekilde Taşınır?

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.

Bir WordPress sitesini alt alan adından kök alan adına taşımak mı istiyorsunuz?

Süreci takip etmek oldukça kolaydır ve SEO sıralamalarınızı kurtarmanın da bir yolu vardır.

Bu makalede, adım adım talimatlarla WordPress’i subdomain’den root domain’e nasıl kolayca taşıyacağınızı göstereceğiz.

Moving a WordPress site from subdomain to root domain

WordPress’i Subdomain’den Root Domain’e Aktarma

Alt alan adı, kök alan adınızın bir uzantısıdır. Örneğin, http://yourwebsite.example.com example.com’un bir alt alan adıdır. Bu durumda, example.com kök alan adıdır.

Arama motorları alt alan adını tamamen farklı bir web sitesi olarak değerlendirir. Bu nedenle, aktarımdan sonra arama motorlarını kök alan adına doğru şekilde yönlendirdiğinizden emin olmanız gerekir. Bu, web sitenizi taşıdıktan sonra arama sıralamalarını korumanıza yardımcı olacaktır.

Bir WordPress sitesini yeni bir ana bilgisay ara veya yeni bir alan adına taşımanın aksine, bir siteyi kök alan adına taşımak biraz daha kolaydır.

Öncelikle, her ikisi de genellikle aynı web barındırma şirketinde barındırıldığı için. Bu, birkaç adımı atlamanızı sağlar.

Bir WordPress sitesinin alt alan adından kök alan adına nasıl taşınacağına bir göz atalım.

Adım 1. Web Sitenizin Eksiksiz Bir Yedeğini Oluşturun

Otomatik yedeklemeler için web sitenizde her zaman yüklü bir yedekleme çözümü bulundurmalısınız. WordPress içeriğinizi güvende tutmak için kullanabileceğiniz çok sayıda WordPress yedekleme eklentisi vardır.

Şimdi, zaten yüklü bir yedekleme eklentiniz varsa, bu adımı atlayabileceğinizi düşünüyor olabilirsiniz.

Bu adım, web sitenizin otomatik yedeklerini almış olsanız bile, yine de sitenizin tam bir yedeğini oluşturmanız gerektiğini hatırlatmak içindir. Bu, bir veritabanı yedeğinin yanı sıra tüm WordPress dosya ve klasörlerinizin yedeğini de içerir.

Tam bir yedekleme oluşturduktan sonra, bunu uzak bir konumda veya bilgisayarınızda sakladığınızdan emin olun.

Adım 2. WordPress Dosyalarınızı Subdomain’den Kök Klasöre Taşıma

Öncelikle, bir FTP istemcisi veya cPanel’in dosya yöneticisini kullanarak web sitenize bağlanmanız gerekir. Bağlandıktan sonra, alt klasör konumunuza gidin ve tüm WordPress dosyalarınızı bilgisayarınıza indirin.

Download WordPress files

Ardından, kök alan adınızın public_html klasörünü açın. WordPress barındırma ortamınızın nasıl kurulduğuna bağlı olarak, bu klasör www veya alan adınızdan sonra da adlandırılabilir.

Şimdi, daha önce indirdiğiniz tüm WordPress dosyalarını kök dizine yüklemeniz gerekir.

Upload WordPress files to root domain

3. Adım WordPress URL ve Site URL Ayarlarını Değiştirin

WordPress dosyalarını taşıdığınızda, kök alan adındaki WordPress yönetici alanına erişemezsiniz. Kök web sitesinde oturum açmaya çalıştığınızda sizi alt alan web sitesinin yönetici alanına geri gönderecektir.

Bunu düzeltmek için FTP istemcisine geçin ve alan adınızın kök dizinine gidin. Ardından, wp-config.php dosyasını düzenlemeniz ve aşağıdaki satırları ‘Hepsi bu, düzenlemeyi durdurun! Mutlu bloglar’.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

example.com yerine kendi alan adınızı yazmayı unutmayın. Kök web sitenizin www kullanmasını istiyorsanız, URL’leri www önekiyle girmeniz gerekecektir.

Değişikliklerinizi kaydedin ve wp-config.php dosyasını web sitenize geri yükleyin.

Artık WordPress sitenizin kök alan adındaki yönetici alanını ziyaret edebilirsiniz.

Adım 4. URL’leri Güncelle

WordPress siteniz kök etki alanına taşındı, ancak WordPress veritabanınızda alt etki alanına işaret eden bağlantılar olacaktır.

Hadi bunu düzeltelim.

Search & Replace Everything eklentisini yüklemeniz ve etkinleştirmeniz gerekecektir. Daha fazla ayrıntı için WordPress eklentisi yükleme hakkındaki adım adım kılavuzumuza bakın.

Etkinleştirmenin ardından, WordPress yönetici panelinizden Araçlar ” WP Arama ve Değiştirme sayfasını ziyaret etmeniz gerekir.

Sayfanın üst kısmında, ‘Ara’ alanının yanına alt alan adı URL’nizi girmeniz ve ‘Şununla değiştir’ alanına kök alan adınızı eklemeniz gerekir.

Add subdomain and root domain to search and replace fields

Sayfayı aşağı kaydırdığınızda, WordPress veritabanınızdaki yazılarınız, yorumlarınız, seçenekleriniz, kullanıcı verileriniz, terimleriniz ve diğer alanlar gibi belirli tablolardaki URL’leri güncellemeyi seçebilirsiniz. Ya da tüm tabloları seçebilirsiniz.

Ardından, ‘Arama ve Değiştirmeyi Önizle’ düğmesine basın.

Select all tables in Search & Replace Everything

Eklenti daha sonra size yapacağı tüm değişikliklerin bir önizlemesini gösterecektir.

Her şey yolunda görünüyorsa, devam etmek için ‘Tümünü Değiştir’ düğmesine tıklayın.

Preview changes and click Replace All

Eklenti artık WordPress veritabanınızdaki tüm URL’leri güncelleyecektir.

Adım 5. Tüm Alt Alan Trafiğini Kök Alana Yönlendirin

Artık WordPress dosyalarını taşıdığınıza göre, alt alan adı trafiğinizin kök alan adına yönlendirildiğinden emin olalım.

Subdomain klasörünüze gidin ve gizli dosyaların görünür olmaya zorlandığından emin olun.

FTP istemci ayarlarınızda gizli dosyaları her zaman göstermek için bir seçenek vardır. FileZilla’da, Sunucu ” Gizli Dosyaları Göstermeye Zorla seçeneği altında bulunur.

Show hidden files

Eğer cPanel Dosya Yöneticisi kullanıyorsanız, ekranın sağ üst köşesindeki ‘Ayarlar’ düğmesine tıklayın. Bu, tercihler açılır penceresini getirecektir. ‘Gizli dosyaları göster’ seçeneğini seçmeniz ve ardından ‘Kaydet’ düğmesine tıklamanız gerekir.

Show hidden files in cPanel file manager

Subdomain klasörünüzde zaten bir .htaccess dosyası varsa, bunu silebilir ve yeni bir tane oluşturabilirsiniz. Yeni .htaccess dosyasının içine aşağıdaki kodu kopyalayıp yapıştırmanız gerekir:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^yoursubdomain\.example\.com$ [NC]
RewriteRule ^(.*)$ "http://example.com/$1" [R=301,L]
</IfModule>

Alt alan adınızı gerçek alt alan adınızla ve example.com adresini alan adınızla değiştirmeyi unutmayın.

RewriteRule satırının www olmayan bir URL kullandığını lütfen unutmayın. Kök alan adınızda www kullanmak istiyorsanız, URL’nizi www önekiyle eklemeniz gerekecektir.

Değişikliklerinizi kaydedin ve .htaccess dosyanızı sunucuya yükleyin.

Hepsi bu kadar. Sitenizi subdomain’den root domain’e başarıyla taşıdınız. Artık web sitenizi ziyaret ederek çalıştığını görebilirsiniz. Her şeyin yolunda gittiğinden emin olmak için web sitenizi test edin.

Umarız bu makale sitenizi alt alan adından kök alan adına taşımanıza yardımcı olmuştur. Ayrıca yeni başlayanlar için nihai WordPress SEO kılavuzumuzu ve WordPress için en iyi 404 yönlendirme eklentileri seçimlerimizi de 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

65 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. Jiří Vaněk says

    Previously, I rewrote the URL using phpMyAdmin directly in the database, which was tedious for me. That’s why I was interested in the Go Live Update URLs plugin mentioned in the article. Thanks for the tip; according to the description, I feel that it will significantly speed up my migration work and I won’t have to make changes manually via the MySQL database. Great tip.

  3. Heidary says

    hello and thank you for this article
    i moved a website from subdomain to domain but the problem that i have is when i enter the subdomain url in the browser the website is being displayed but the url that is being displayed in the address bar is the subdomain , and when i click one of the links on the website then i am being redirected to main domain , please note there is nothing on the subdomain right now.
    i do have 301 redirect on the subdomain but something doesn’t seem to be working properly , any idea what could be causing this? any help or tip would be appreciated
    thank you in advance

    • WPBeginner Support says

      If you’ve already done the step to update your URLs, we would recommend checking your Settings>general page to ensure the URL was updated correctly there.

      Yönetici

  4. Jesse Dill says

    I am going through the steps and on step 3, I followed the php syntax but it caused some errors and I couldn’t get to any of the wordpress admin sites. I had to remove the pre tags and just use:

    define(‘WP_HOME’,’http://example.com’);
    define(‘WP_SITEURL’,’http://example.com’);

    After that it worked. Just in case anyone comes across the same issue as me.

  5. sarah says

    Hi, Step two doesn’t seem to work for me as CPanel won’t let me download the directory sub.example.com

    I can download individual files but not folders or directories. I have tried compressing to .zip but the .zip file is empty.

    Can you please advise? Many thanks

  6. Jessica says

    I see that Velvet Blues Update URLs plugin on wordpress.org is noted “This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.”

    Do you recommend a different plugin now or to still use this one?

  7. Caleb Byers says

    Do you need to update anything in the databases after doing the steps in the article? Whenever moving a site I’ve seen people say that there are a few steps in the databases, but not in this article… Is there a reason why?
    Thanks.

  8. Del Abernethy says

    Worked a charm up until I tried to login to wp-admin. The site already had files (which I over-wrote) and users but now it won’t recognise the existing users. It does allow me to login using the username & password from the sub-domain so I’m assuming it is linked to the sub-domain database. Is it possible to link it to the existing original database?

    • WPBeginner Support says

      You would want to check the wp-config file for the database it is connected to for your site and you would be able to change that in your file. That would normally happen if you didn’t overwrite the existing file if you were trying to replace a site with the one on the subdomain.

      Yönetici

    • WPBeginner Support says

      It would depend on what references you are talking about. If you mean links in the articles then the velvet blues plugin updates those.

      Yönetici

    • WPBeginner Support says

      You would likely want to check with your hosting provider to ensure they don’t have a firewall and your SSL certificate is active as the most common reasons

      Yönetici

  9. Ben says

    Hey – do you reccomend also using Googles change of address tool, to tell it subdomain.primarydomain.com is now primarydomain.com ?

    thanks

    • WPBeginner Support says

      If you want you can also use that tool, the redirects would normally resolve this for you.

      Yönetici

  10. Sara says

    Hi,
    I followed your steps up until the end of step 3, where I have edited the wp-config.php file
    I then go to the wp-admin. I enter my details and it just goes back to the same login. It’s not allowing me to login to the wordpress backend.
    It’s like it’s redirecting me.
    Are you able to help?
    I’d really appreciate it.
    Thanks,
    Sara

  11. Sofia says

    Hello, I did everything and it worked! But now I’m wondering, how do I keep my subdomain as a “staging” website, so that I can change things and not affect the one on the domain. I’d have to make a new database (using a backup) right?
    How to assure I don’t do anything wrong?

  12. Oliver says

    In my subdomain folder, I have 2 .htaccess files. One is in subdomains/example, the other is in subdomains/example/web. The latter is next to all the other wordpress files. Which one should I delete and replace with the code in step 5?

    • WPBeginner Support says

      You may need to check with your host but from the sound of it, you would modify the second one.

      Yönetici

  13. Aldo Salim says

    Hi, thank you so much for the great help.

    However, i do not want to keep the old sub-directory folder. Will it be okay to delete the sub-directory folder?

  14. Joshua Orizu says

    I am building a websites and the domain name is displaying site.comp50 instead of site.com how do i fix this

    • WPBeginner Support says

      You may want to check with your hosting provider to ensure the correct domain is attached to where your site is and then you would be able to update the url in your Settings>General area

      Yönetici

  15. Jeremy says

    What happens to the blog posts on the root domain during a migration?

    I currently built a redesigned site on a subdomain, Sandbox.WebsiteName.com, and want to migrate it over to the the root domain. However, I want to keep the blog posts.

    i’m worried about the seo. Do the blog post from the root domain get overwritten? If not how would i access them to redirect them?

    Thanks,

  16. Madison says

    Hi,

    Would this method work if I wanted to move a subdomain, which a friend uses, ie, xxx.example.com, over to their new account so it can be its own website like xxx.com?

    If not, is there anything that would work at all or would they just have to start over, thus losing all the comments, page views, etc?

  17. Rui says

    Hi,
    This tutorial is great, but didn’t work for me. I don’t know why.

    I can access to admin area, in homepage the images are not shown and when i tried to access posts and products says “Not Found
    The requested URL /shop/index.php was not found on this server.”

    I would like some help if possible.
    Thank you a lot

    • WPBeginner Support says

      You may want to ensure steps 3 and 4 were completed for the most common reason for that.

      Yönetici

    • Canonical Bear says

      Hi,
      We had the same problem (my team and I). Only the Home Page would open, and all other pages were broken.
      You need to update the permalinks. Go to Dashboard ->Settings -> Permalinks. Here, don’t make any changes, just click on “Save Changes”.
      It re-apply settings with the current directory as root.
      All the best.

  18. Milan says

    Hello WP Team,

    just one quick question… what is the difference between this procedure and clone website from cpanel installatron (godaddy). Can I use clone for same purpose? Do I need to made some additional changes after cloning. It’s looks much easier to do this with clone option.

    Thanks for good work!

  19. Melind says

    This worked like a charm! The part that takes the longest is uploading and downloading the files. Thank you!

  20. smv says

    This didn’t work for me at all. Step 4, using the Velvet Blues plug-in to update the URLs, didn’t update most of them. There were still loads of references to the old site. I had to re-do everything, but I used the duplicator plug-in, which worked well.

  21. Gábor Sztárcsevics says

    Hi!

    Is this modification will change the records in the database, which is used for my wordpress on the subdomain.example.com?

    Shouldn’t I create a new database for the migrated wordpress?

    Thank you!

    • WPBeginner Support says

      Hi Gábor Sztárcsevics,

      Since you are moving from subdomain to root domain on the same hosting environment, your old database would work just fine after you update URLs as shown in the tutorial.

      However, if you would like to create a new database, then you can do that as well. You will then need to export your data from the old database to the new one and update URLs.

      Yönetici

  22. Shravan says

    RewriteCond %{HTTP_HOST} ^yoursubdomain\.example\.com$

    in this code, do i need to remove those 2 backward slash’s

  23. Denise says

    I don’t see where you remove the old wordpress files. Are they automatically replaced when you upload the subdomain files to the root?
    Thank you.

  24. Charlotte Jones says

    I tried this and got a HTTP 500 error. Luckily I backed everything up, but I don’t understand. All the files are there in public_html and I changed the wp-config file to point to the root domain.

  25. Jon says

    Very good thank you. Went like a dream apart from an error I made by amending the old subdomain .htaccess file instead of the new one in the root. Your advice was excellent tho.

  26. Juan F. says

    Hi guys,

    After doing all the steps, if I want to save a page I get an error and automatically redirects me to the post list, could you help me please?

    Thanks in advance.

    • Anita says

      Hello!
      If I make the site in the exemple.com/Wordpress folder, do I have to move it to the example.com folder or can I just redirect it, how does that work?
      /Anita

  27. Ousman Faal says

    This was definitely useful. I was just about to change a demo site on a sub domain to a root domain.
    You guys are live savers.

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.