{"id":2494,"date":"2026-10-06T12:30:00","date_gmt":"2026-10-06T09:30:00","guid":{"rendered":"https:\/\/narhost.com\/destek\/?p=2494"},"modified":"2026-10-06T12:30:00","modified_gmt":"2026-10-06T09:30:00","slug":"web-config-301-yonlendirme","status":"publish","type":"post","link":"https:\/\/narhost.com\/destek\/web-config-301-yonlendirme\/","title":{"rendered":"web.config ile 301 Y\u00f6nlendirme Nas\u0131l Yap\u0131l\u0131r (IIS)"},"content":{"rendered":"<p class=\"kb-dogrulama\">Son g\u00f6zden ge\u00e7irme: Eyl\u00fcl 2026 \u00b7 IIS 10 URL Rewrite resm\u00ee dok\u00fcman\u0131na g\u00f6re, Plesk Obsidian 18.0 men\u00fc yolu panelde do\u011fruland\u0131<\/p>\n<div id=\"hizli-cozum\" class=\"ai-box ai-box--cozum\">\n<p class=\"ai-box-title\">H\u0131zl\u0131 \u00e7\u00f6z\u00fcm<\/p>\n<p><strong>web config 301 y\u00f6nlendirme<\/strong> i\u00e7in sitenin k\u00f6k klas\u00f6r\u00fcndeki <code>web.config<\/code> dosyas\u0131na, mevcut <code>&lt;system.webServer&gt;<\/code> b\u00f6l\u00fcm\u00fcn\u00fcn i\u00e7ine bir URL Rewrite kural\u0131 eklenir ve kurala <code>redirectType=\"Permanent\"<\/code> verilir.<\/p>\n<ol>\n<li><code>web.config<\/code> dosyas\u0131n\u0131n yede\u011fini indirin.<\/li>\n<li>Dosyay\u0131 Plesk&#8217;te <strong>Files \u2192 httpdocs \u2192 web.config \u2192 Edit in Code Editor<\/strong> ile a\u00e7\u0131n.<\/li>\n<li><code>&lt;rewrite&gt;&lt;rules&gt;<\/code> blo\u011funu <code>&lt;system.webServer&gt;<\/code> i\u00e7ine yap\u0131\u015ft\u0131r\u0131p kaydedin.<\/li>\n<li><code>curl.exe -I<\/code> ile yan\u0131t\u0131n <code>301<\/code> d\u00f6nd\u00fc\u011f\u00fcn\u00fc do\u011frulay\u0131n.<\/li>\n<\/ol>\n<\/div>\n<table class=\"kb-uyg\">\n<tr>\n<th>Panel<\/th>\n<td>Plesk (Windows hosting) ya da IIS Y\u00f6neticisi (VDS)<\/td>\n<\/tr>\n<tr>\n<th>Sistem<\/th>\n<td>IIS 10, Windows Server 2019\/2022<\/td>\n<\/tr>\n<tr>\n<th>Yetki<\/th>\n<td>Plesk abonelik kullan\u0131c\u0131s\u0131 ya da sunucuda Administrator<\/td>\n<\/tr>\n<tr>\n<th>Narhost \u00fcr\u00fcn\u00fc<\/th>\n<td><a href=\"https:\/\/narhost.com\/windows-hosting\" title=\"Narhost Windows Hosting paketleri\">Windows Hosting<\/a><\/td>\n<\/tr>\n<\/table>\n<div class=\"kb-once\">\n<p class=\"label\">Ba\u015flamadan \u00f6nce<\/p>\n<ul>\n<li>Mevcut <code>web.config<\/code> dosyas\u0131n\u0131 bilgisayar\u0131n\u0131za indirin. XML&#8217;deki tek bir yaz\u0131m hatas\u0131 b\u00fct\u00fcn sitenin 500 hatas\u0131 vermesine yol a\u00e7ar.<\/li>\n<li>URL Rewrite mod\u00fcl\u00fc IIS&#8217;e ayr\u0131ca kurulur. VDS&#8217;te <code>Test-Path \"$env:windir\\System32\\inetsrv\\rewrite.dll\"<\/code> komutu <code>True<\/code> d\u00f6nmelidir.<\/li>\n<li>Eski ve yeni adreslerin listesini haz\u0131rlay\u0131n; her eski adres tek bir yeni adrese gitmelidir.<\/li>\n<\/ul>\n<\/div>\n<h2>web config 301 y\u00f6nlendirme ne i\u015fe yarar<\/h2>\n<p>IIS <code>.htaccess<\/code> dosyas\u0131n\u0131 okumaz; Linux hostingdeki y\u00f6nlendirme kurallar\u0131n\u0131n Windows kar\u015f\u0131l\u0131\u011f\u0131 <code>web.config<\/code> dosyas\u0131d\u0131r. 301 kal\u0131c\u0131 ta\u015f\u0131nd\u0131 anlam\u0131na gelir: taray\u0131c\u0131 ve arama motoru eski adresi b\u0131rak\u0131p yeni adrese ge\u00e7er, s\u0131ralama da zamanla yeni adrese aktar\u0131l\u0131r. Sayfa ad\u0131 de\u011fi\u015fti\u011finde, alan ad\u0131 ta\u015f\u0131nd\u0131\u011f\u0131nda ya da SSL sonras\u0131 HTTP trafi\u011fini HTTPS&#8217;e \u00e7ekerken kullan\u0131l\u0131r.<\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/iis\/extensions\/url-rewrite-module\/url-rewrite-module-configuration-reference\" title=\"URL Rewrite Module Configuration Reference \u2014 Microsoft Learn\" target=\"_blank\" rel=\"noopener\">URL Rewrite yap\u0131land\u0131rma ba\u015fvurusuna g\u00f6re<\/a><code>redirectType<\/code> d\u00f6rt de\u011fer al\u0131r: <code>Permanent<\/code> (301), <code>Found<\/code> (302), <code>SeeOther<\/code> (303) ve <code>Temporary<\/code> (307). Kal\u0131c\u0131 ta\u015f\u0131mada yaln\u0131z <code>Permanent<\/code> kullan\u0131n. cPanel&#8217;li Linux hostingte ayn\u0131 i\u015f i\u00e7in bkz. <a href=\"https:\/\/narhost.com\/destek\/cpanelde-301-yonlendirme-nasil-yapilir\/\" title=\"cPanel&#039;de 301 y\u00f6nlendirme nas\u0131l yap\u0131l\u0131r \u2014 Narhost Destek\">cPanel&#8217;de 301 y\u00f6nlendirme<\/a>.<\/p>\n<h2>Ad\u0131m ad\u0131m web.config ile y\u00f6nlendirme<\/h2>\n<ol class=\"kb-adimlar\">\n<li><strong>Dosyay\u0131 a\u00e7\u0131n.<\/strong> Plesk&#8217;te <strong>Websites &amp; Domains \u2192 Files<\/strong> yolunu izleyip <code>httpdocs<\/code> klas\u00f6r\u00fcne girin, <code>web.config<\/code> sat\u0131r\u0131ndaki men\u00fcden <strong>Edit in Code Editor<\/strong> se\u00e7in. Plesk bu dosyay\u0131 hata sayfalar\u0131 i\u00e7in kendisi olu\u015fturur; i\u00e7inde zaten bir <code>&lt;system.webServer&gt;<\/code> b\u00f6l\u00fcm\u00fc vard\u0131r. VDS&#8217;te dosya sitenin fiziksel yolundad\u0131r (varsay\u0131lan site i\u00e7in <code>C:\\inetpub\\wwwroot<\/code>).<br \/>\n<figure class=\"nh-sema\"><img src=\"https:\/\/narhost.com\/destek\/wp-content\/uploads\/2026\/09\/web-config-301-yonlendirme-sema-narhost.webp\" alt=\"Web config 301 y\u00f6nlendirme ak\u0131\u015f \u015femas\u0131 \u2014 yedek, kural yeri, kural yazma ve curl ile do\u011frulama\" width=\"1200\" height=\"500\" loading=\"lazy\" decoding=\"async\"><figcaption>IIS&#x27;te kal\u0131c\u0131 y\u00f6nlendirme d\u00f6rt ad\u0131mda kurulur: yedek al\u0131n, do\u011fru b\u00f6l\u00fcm\u00fc bulun, kural\u0131 yaz\u0131n, yan\u0131t\u0131 do\u011frulay\u0131n.<\/figcaption><\/figure>\n<\/li>\n<li><strong>Kurallar\u0131 do\u011fru yere yerle\u015ftirin.<\/strong> \u0130kinci bir <code>&lt;system.webServer&gt;<\/code> a\u00e7may\u0131n; <code>&lt;rewrite&gt;<\/code> blo\u011funu var olan\u0131n i\u00e7ine ekleyin.\n<pre><code class=\"language-xml\">&lt;configuration&gt;\n  &lt;system.webServer&gt;\n    &lt;httpErrors&gt; ... &lt;\/httpErrors&gt;\n    &lt;rewrite&gt;\n      &lt;rules&gt;\n        &lt;!-- kurallar buraya --&gt;\n      &lt;\/rules&gt;\n    &lt;\/rewrite&gt;\n  &lt;\/system.webServer&gt;\n&lt;\/configuration&gt;<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7: dosyada tek bir <code>&lt;system.webServer&gt;<\/code> ve onun i\u00e7inde tek bir <code>&lt;rules&gt;<\/code> listesi bulunur; a\u015fa\u011f\u0131daki kurallar bu listeye eklenir.<\/p>\n<\/li>\n<li><strong>Tek sayfay\u0131 y\u00f6nlendirin.<\/strong><code>match url<\/code> de\u011feri alan ad\u0131ndan sonraki yoldur ve ba\u015ftaki <code>\/<\/code> i\u015faretini i\u00e7ermez.\n<pre><code class=\"language-xml\">&lt;rule name=\"eski-sayfa-301\" stopProcessing=\"true\"&gt;\n  &lt;match url=\"^eski-sayfa\\.html$\" \/&gt;\n  &lt;action type=\"Redirect\" url=\"\/yeni-sayfa\/\" redirectType=\"Permanent\" \/&gt;\n&lt;\/rule&gt;<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7: <code>\/eski-sayfa.html<\/code> iste\u011fi <code>\/yeni-sayfa\/<\/code> adresine 301 ile gider.<\/p>\n<\/li>\n<li><strong>HTTP trafi\u011fini HTTPS&#8217;e \u00e7ekin.<\/strong> SSL kurulu de\u011filse bu kural siteyi a\u00e7\u0131lmaz h\u00e2le getirir.\n<pre><code class=\"language-xml\">&lt;rule name=\"https-301\" stopProcessing=\"true\"&gt;\n  &lt;match url=\"(.*)\" \/&gt;\n  &lt;conditions&gt;\n    &lt;add input=\"{HTTPS}\" pattern=\"off\" ignoreCase=\"true\" \/&gt;\n  &lt;\/conditions&gt;\n  &lt;action type=\"Redirect\" url=\"https:\/\/{HTTP_HOST}\/{R:1}\" redirectType=\"Permanent\" \/&gt;\n&lt;\/rule&gt;<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7: <code>http:\/\/<\/code> ile gelen her istek ayn\u0131 yolun <code>https:\/\/<\/code> s\u00fcr\u00fcm\u00fcne gider.<\/p>\n<\/li>\n<li><strong>Eski alan ad\u0131n\u0131 yenisine ta\u015f\u0131y\u0131n.<\/strong> Eski alan ad\u0131 ayn\u0131 siteye takma ad olarak ba\u011fl\u0131ysa bu kural b\u00fct\u00fcn yollar\u0131 korur.\n<pre><code class=\"language-xml\">&lt;rule name=\"alan-adi-301\" stopProcessing=\"true\"&gt;\n  &lt;match url=\"(.*)\" \/&gt;\n  &lt;conditions&gt;\n    &lt;add input=\"{HTTP_HOST}\" pattern=\"^(www\\.)?eski-ornek\\.com$\" \/&gt;\n  &lt;\/conditions&gt;\n  &lt;action type=\"Redirect\" url=\"https:\/\/www.ornek.com\/{R:1}\" redirectType=\"Permanent\" \/&gt;\n&lt;\/rule&gt;<\/code><\/pre>\n<p class=\"kb-cikti\">Yaln\u0131z www ile www&#8217;suz s\u00fcr\u00fcm\u00fc birle\u015ftirecekseniz kural yazman\u0131z gerekmez: Plesk&#8217;te <strong>Hosting Settings \u2192 Preferred domain<\/strong> alan\u0131 ayn\u0131 i\u015fi 301 ile yapar.<\/p>\n<\/li>\n<li><strong>Mod\u00fcl yoksa httpRedirect kullan\u0131n.<\/strong> B\u00fct\u00fcn siteyi ba\u015fka bir alan ad\u0131na ta\u015f\u0131rken <a href=\"https:\/\/learn.microsoft.com\/en-us\/iis\/configuration\/system.webserver\/httpredirect\/\" title=\"HTTP Redirects httpRedirect \u2014 Microsoft Learn\" target=\"_blank\" rel=\"noopener\">httpRedirect \u00f6\u011fesi<\/a> URL Rewrite olmadan \u00e7al\u0131\u015f\u0131r; IIS&#8217;in HTTP Redirection \u00f6zelli\u011fi kurulu olmal\u0131d\u0131r. Bu sat\u0131r\u0131 hedef sitenin kendi <code>web.config<\/code> dosyas\u0131na koymay\u0131n, d\u00f6ng\u00fc olu\u015fur.\n<pre><code class=\"language-xml\">&lt;httpRedirect enabled=\"true\" destination=\"https:\/\/www.ornek.com\" httpResponseStatus=\"Permanent\" \/&gt;<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2>Do\u011frulama<\/h2>\n<div class=\"success-box\">\n<p class=\"label\">Sonu\u00e7<\/p>\n<p>Kendi bilgisayar\u0131n\u0131zda <code>curl.exe -I http:\/\/ornek.com\/eski-sayfa.html<\/code> komutu <code>HTTP\/1.1 301 Moved Permanently<\/code> ve do\u011fru <code>Location<\/code> sat\u0131r\u0131n\u0131 d\u00f6nd\u00fcr\u00fcyorsa web config 301 y\u00f6nlendirme \u00e7al\u0131\u015f\u0131yordur. Taray\u0131c\u0131da denerken gizli pencere kullan\u0131n; taray\u0131c\u0131lar 301 yan\u0131t\u0131n\u0131 \u00f6nbellekte tutar.<\/p>\n<\/div>\n<h2>H\u00e2l\u00e2 \u00e7\u00f6z\u00fclmediyse<\/h2>\n<ul>\n<li><strong>Kaydettikten sonra site 500.19 hatas\u0131 veriyor.<\/strong> XML&#8217;de kapanmayan bir etiket, \u00e7ift <code>&lt;system.webServer&gt;<\/code> ya da kurulu olmayan URL Rewrite mod\u00fcl\u00fc vard\u0131r. Yede\u011fi geri y\u00fckleyin ve kurallar\u0131 tek tek ekleyin.<\/li>\n<li><strong>Taray\u0131c\u0131 ERR_TOO_MANY_REDIRECTS veriyor.<\/strong> HTTPS kural\u0131 ile paneldeki bir y\u00f6nlendirme \u00e7ak\u0131\u015f\u0131yordur; bkz. <a href=\"https:\/\/narhost.com\/destek\/ssl-sonrasi-site-yonlendirmesi-nasil-duzeltilir\/\" title=\"SSL sonras\u0131 site y\u00f6nlendirmesi nas\u0131l d\u00fczeltilir \u2014 Narhost Destek\">SSL sonras\u0131 y\u00f6nlendirme sorunlar\u0131<\/a>.<\/li>\n<li><strong>Kural hi\u00e7 \u00e7al\u0131\u015fm\u0131yor.<\/strong> Dosya yanl\u0131\u015f klas\u00f6rde olabilir ya da site IIS&#8217;te farkl\u0131 bir yolu g\u00f6steriyordur; bkz. <a href=\"https:\/\/narhost.com\/destek\/iis-uzerinde-site-nasil-yayinlanir\/\" title=\"IIS \u00fczerinde site nas\u0131l yay\u0131nlan\u0131r \u2014 Narhost Destek\">IIS \u00fczerinde site yay\u0131nlama<\/a>.<\/li>\n<\/ul>\n<div class=\"cta-box\">\n<p class=\"label\">Narhost deste\u011fi<\/p>\n<p>Talebe \u015funlar\u0131 ekleyin: alan ad\u0131n\u0131z, y\u00f6nlendirmek istedi\u011finiz eski ve yeni adres, <code>curl.exe -I<\/code> \u00e7\u0131kt\u0131s\u0131 ve <code>web.config<\/code> dosyas\u0131ndaki <code>&lt;rewrite&gt;<\/code> blo\u011fu.<\/p>\n<p><a class=\"cta-btn\" href=\"https:\/\/narhost.com\/submitticket.php\" title=\"Narhost destek talebi olu\u015ftur\">Destek talebi a\u00e7<\/a><\/div>\n<div class=\"kb-ilgili\">\n<p class=\"label\">Sonraki ad\u0131mlar<\/p>\n<ul>\n<li><a href=\"https:\/\/narhost.com\/destek\/windows-hosting\/\" title=\"Windows hosting kartlar\u0131 \u2014 Narhost Destek\">Windows hosting kartlar\u0131n\u0131n tamam\u0131<\/a><\/li>\n<li><a href=\"https:\/\/narhost.com\/destek\/iis-kurulumu-windows-server\/\" title=\"Windows Server&#039;da IIS kurulumu \u2014 Narhost Destek\">Windows Server&#8217;da IIS kurulumu<\/a><\/li>\n<li><a href=\"https:\/\/narhost.com\/destek\/net-core-projesini-iiste-yayinlama\/\" title=\".NET Core projesini IIS&#039;te yay\u0131nlama \u2014 Narhost Destek\">.NET Core projesini IIS&#8217;te yay\u0131nlama<\/a><\/li>\n<li><a href=\"https:\/\/narhost.com\/blog\/iis-manager-nedir\/\" title=\"IIS Manager nedir \u2014 Narhost Blog\">IIS Manager ne i\u015fe yarar<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"kb-faq\">\n<h2>S\u0131k\u00e7a sorulan sorular<\/h2>\n<h3>Windows hostingte .htaccess ile y\u00f6nlendirme yapabilir miyim?<\/h3>\n<p>Hay\u0131r. IIS <code>.htaccess<\/code> dosyas\u0131n\u0131 okumaz; kurallar\u0131 <code>web.config<\/code> i\u00e7ine URL Rewrite s\u00f6z dizimiyle yazman\u0131z gerekir.<\/p>\n<h3>301 ile 302 aras\u0131ndaki fark nedir?<\/h3>\n<p>301 kal\u0131c\u0131d\u0131r ve arama motoru yeni adresi dizine al\u0131r. 302 ge\u00e7icidir; eski adres dizinde kal\u0131r. Sayfa geri gelmeyecekse 301 kullan\u0131n.<\/p>\n<h3>\u00c7ok say\u0131da eski adresi tek tek yazmak zorunda m\u0131y\u0131m?<\/h3>\n<p>Ortak bir kal\u0131p varsa tek kural ve <code>{R:1}<\/code> yeterlidir. Kal\u0131p yoksa URL Rewrite&#8217;\u0131n rewriteMaps \u00f6zelli\u011fiyle eski-yeni adres listesini tek kuralda toplayabilirsiniz.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>IIS&#8217;te web.config dosyas\u0131yla kal\u0131c\u0131 301 y\u00f6nlendirme: URL Rewrite kural\u0131n\u0131n yeri, tek sayfa, HTTP&#8217;den HTTPS&#8217;e ve alan ad\u0131 ta\u015f\u0131ma kurallar\u0131, httpRedirect alternatifi, Plesk&#8217;te dosyay\u0131 d\u00fczenleme ve 500.19 ile d\u00f6ng\u00fc hatalar\u0131n\u0131n \u00e7\u00f6z\u00fcm\u00fc.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,12],"tags":[159,221],"class_list":["post-2494","post","type-post","status-publish","format-standard","hentry","category-windows-hosting","category-vds-server","tag-iis","tag-windows-server"],"meta_box":[],"_links":{"self":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/2494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/comments?post=2494"}],"version-history":[{"count":1,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/2494\/revisions"}],"predecessor-version":[{"id":2862,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/2494\/revisions\/2862"}],"wp:attachment":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/media?parent=2494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/categories?post=2494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/tags?post=2494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}