Ana SayfaPlaygroundShowcaseUygulamaDokümanBlog
    • Englishİngilizce
      EN
    • русскийRusça
      RU
    • 日本語Japonca
      JA
    • françaisFransızca
      FR
    • 한국어Korece
      KO
    • 中文Çince
      ZH
    • españolİspanyolca
      ES
    • DeutschAlmanca
      DE
    • العربيةArapça
      AR
    • italianoİtalyanca
      IT
    • British Englishİngiliz İngilizcesi
      EN-GB
    • portuguêsPortekizce
      PT
    • हिन्दीHintçe
      HI
    • TürkçeTürkçe
      TR
    • polskiLehçe
      PL
    • IndonesiaEndonezce
      ID
    • Tiếng ViệtVietnamca
      VI
    • українськаUkraynaca
      UK
    /
    Çerçeveye göre belgeleri filtrele
    Alt+←
    Neden Intlayer?
    Başla
    Kavram
    • Intlayer Nasıl Çalışır
    • Yapılandırma
    • TestFillBuildWatchExtractLoginPushPullConfigurationListVersionEditorLiveDebugDoc ReviewDoc TranslateSDK
    • Görsel Editör
    • CMS
    • CI/CD Entegrasyonu
    • ÇeviriÇoğulNumaralandırmaKoşulCinsiyetEklemeDosyaİç İçe GeçmeMarkdownHTMLFonksiyon Getirme
    • Yerel Dosya
    • Derleyici
    • Otomatik Doldurma
    • Test
    • Paket Optimizasyonu
    Ortam
    • Next.js 14 ve Uygulama Yönlendirici
      Next.js 15
      Next.js locale’siz URL
      Next.js ve Sayfa Yönlendirici
      Derleyici
    • Tanstack Start Solid
    • Astro ve React
      Astro ve Svelte
      Astro ve Vue
      Astro ve Solid
      Astro ve Preact
      Astro ve Lit
      Astro ve Vanilla JS
    • React Router v7
      React Router v7 (fs-routes)
      Compiler
    • Nuxt ve Vue
    • Vite ve Solid
    • SvelteKit
    • Vite ve Preact
    • Vite ve Vanilla JS
    • Vite ve Lit
    • Angular 19 (Webpack)
      Analog
    • React CRA
    • React Native ve Expo
    • Express.js
      NestJS
      Fastify
      Hono
      Adonis
    • Lynx ve React
    Plugins
    • JSON
    • gettext (.po)
    VS Code Uzantısı
    Aracı
    • MCP Sunucusu
    • Aracı becerileri
    Sürümler
    • v8
    • v7
    • v6
    Karşılaştırma
    • Next.js
    • TanStack
    • Vue
    • Solid
    • Svelte
    Blog
    Bir soru sor
    1. Documentation
    2. Kavram
    3. Custom_url_rewrites
    \n\n ```\n\n \n \n \n ```tsx\n import { useRewriteURL } from \"solid-intlayer\";\n\n const Layout = (props) => {\n useRewriteURL();\n return <>{props.children};\n };\n ```\n\n \n \n \n ```svelte\n \n\n ```\n\n \n\n\n## Router Entegrasyonu ve Proxy'ler\n\nIntlayer'in sunucu tarafı proxy'leri (Vite ve Next.js), SEO tutarlılığını sağlamak için özel yeniden yazmaları otomatik olarak yönetir.\n\n1. **Dahili Yeniden Yazmalar**: Bir kullanıcı `/fr/a-propos` adresini ziyaret ettiğinde, proxy bunu dahili olarak `/fr/about` adresine eşler, böylece framework doğru rotayla eşleşir.\n2. **Yetkili Yönlendirmeler**: Bir kullanıcı elle `/fr/about` yazarsa, proxy `/fr/a-propos`'a 301/302 yönlendirmesi yapar; böylece arama motorları sayfanın yalnızca tek bir sürümünü dizine ekler.\n\n### Next.js Entegrasyonu\n\nNext.js entegrasyonu `intlayerProxy` middleware'i aracılığıyla tamamen yönetilir.\n\n```typescript fileName=\"middleware.ts\"\nimport { intlayerProxy } from \"next-intlayer/middleware\";\nimport { NextRequest } from \"next/server\";\n\nexport function middleware(request: NextRequest) {\n return intlayerProxy(request);\n}\n```\n\n### Vite Entegrasyonu\n\nSolidJS, Vue ve Svelte için `intlayerProxy` Vite eklentisi geliştirme sırasında yeniden yazmaları (rewrites) yönetir.\n\n```typescript fileName=\"vite.config.ts\"\nimport { defineConfig } from \"vite\";\nimport { intlayerProxy } from \"vite-intlayer\";\n\nexport default defineConfig({\n plugins: [intlayerProxy()],\n});\n```\n\n## Temel Özellikler\n\n### 1. Çoklu Bağlam Yeniden Yazmaları\n\nHer formatter, farklı tüketiciler için uzmanlaşmış kuralları içeren bir `RewriteObject` oluşturur:\n\n- `url`: İstemci tarafı URL oluşturma için optimize edilmiştir (locale segmentlerini kaldırır).\n- `nextjs`: Next.js middleware için `[locale]` korur.\n- `vite`: Vite proxy'leri için `:locale` korur.\n\n### 2. Otomatik Pattern Normalizasyonu\n\nIntlayer, tüm kaynak framework'lerinden bağımsız olarak eşlemenin tutarlı kalmasını sağlamak için tüm desen sözdizimlerini dahili olarak normalleştirir (ör. `[param]`'ı `:param`'a dönüştürmek).\n\n### 3. SEO için Yetkili URL'ler\n\nKanonik yollardan daha okunaklı takma adlara yapılan yönlendirmeleri zorunlu kılarak, Intlayer çoğaltılmış içerik sorunlarını önler ve sitenin bulunabilirliğini artırır.\n\n## Temel Yardımcı Fonksiyonlar\n\n- `getLocalizedUrl(url, locale)`: Yeniden yazma kurallarına uyan yerelleştirilmiş bir URL üretir.\n- `getCanonicalPath(path, locale)`: Yerelleştirilmiş bir URL'yi dahili kanonik yoluna çözer.\n- `getRewritePath(pathname, locale)`: Bir yol adının daha okunaklı yerelleştirilmiş takma adına düzeltilmesi gerekip gerekmediğini tespit eder.\n","about":"Intlayer'da yerel-dil özgü yollar tanımlamak için özel URL yeniden yazımlarının nasıl yapılandırılacağını ve kullanılacağını öğrenin.","url":"https://intlayer.org/tr/doc/concept/custom_url_rewrites","datePublished":"13-08-2024","dateModified":"26-01-2026","keywords":"Özel URL Yeniden Yazımları, Yönlendirme, Uluslararasılaştırma, i18n","license":"https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE","audience":{"@type":"Audience","audienceType":"Geliştiriciler, İçerik Yöneticileri"}}
    Oluşturma:2024-08-13Son güncelleme:2026-01-26
    Bu dokümanı favori AI asistanınıza referans verin
    ChatGPT
    Claude
    DeepSeek
    Google AI mode
    Gemini
    Perplexity
    Mistral
    Grok

    Sorunuzu sorun ve bu sayfaya ve seçtiğiniz AI sağlayıcısına referans vererek belgenin bir özetini alın

    Sürüm Geçmişi

    1. "Çerçeveye özgü biçimlendiriciler ve useRewriteURL kancasının kullanımıyla merkezi URL yeniden yazımlarını uygulama."
      v8.0.025.01.2026

    Bu sayfanın içeriği bir yapay zeka kullanılarak çevrildi.

    Orijinal içeriğin İngilizce son sürümünü görüntüleyin
    Bu dokümanı düzenle

    Bu dokümantasyonu geliştirmek için bir fikriniz varsa, lütfen GitHub'da bir çekme isteği göndererek katkıda bulunmaktan çekinmeyin.

    Dokümantasyon için GitHub bağlantısı
    Kopyala

    Belge Markdown'ını panoya kopyala

    Özel URL Yeniden Yazımları Uygulaması

    Intlayer, standart /locale/path yapısından farklı olan yerel-dil özgü yollar tanımlamanıza olanak tanıyan özel URL yeniden yazımlarını destekler. Bu, dahili uygulama mantığını kanonik tutarken İngilizce için /about ve Fransızca için /a-propos gibi URL'lere izin verir.

    Yapılandırma

    Özel yeniden yazımlar, framework'e özgü formatters kullanılarak intlayer.config.ts dosyanızın routing bölümünde yapılandırılır. Bu formatters, tercih ettiğiniz router için doğru sözdizimini sağlar.

    intlayer.config.ts
    Kodu kopyala

    Kodu panoya kopyala

    import { Locales, type IntlayerConfig } from "intlayer";import { nextjsRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ...  routing: {    mode: "prefix-no-default",    rewrite: nextjsRewrite({      "/[locale]/about": {        fr: "/[locale]/a-propos",        es: "/[locale]/acerca-de",      },      "/[locale]/products/[id]": {        fr: "/[locale]/produits/[id]",        es: "/[locale]/productos/[id]",      },    }),  },};export default config;
    intlayer.config.ts
    Kodu kopyala

    Kodu panoya kopyala

    import { Locales, type IntlayerConfig } from "intlayer";import { reactRouterRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ...  routing: {    mode: "prefix-all",    rewrite: reactRouterRewrite({      "/:locale/about": {        fr: "/:locale/a-propos",        es: "/:locale/acerca-de",      },      "/:locale/products/:id": {        fr: "/:locale/produits/:id",        es: "/:locale/productos/:id",      },    }),  },};export default config;
    intlayer.config.ts
    Kodu kopyala

    Kodu panoya kopyala

    import { Locales, type IntlayerConfig } from "intlayer";import { tanstackRouterRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ...  routing: {    mode: "prefix-all",    rewrite: tanstackRouterRewrite({      "/$locale/about": {        fr: "/$locale/a-propos",        es: "/$locale/acerca-de",      },      "/$locale/products/$id": {        fr: "/$locale/produits/$id",        es: "/$locale/productos/$id",      },    }),  },};export default config;
    intlayer.config.ts
    Kodu kopyala

    Kodu panoya kopyala

    import { Locales, type IntlayerConfig } from "intlayer";import { vueRouterRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // diğer ayarlar  routing: {    mode: "prefix-all",    rewrite: vueRouterRewrite({      "/:locale/about": {        fr: "/:locale/a-propos",        es: "/:locale/acerca-de",      },      "/:locale/products/:id": {        fr: "/:locale/produits/:id",        es: "/:locale/productos/:id",      },    }),  },};export default config;
    intlayer.config.ts
    Kodu kopyala

    Kodu panoya kopyala

    import { Locales, type IntlayerConfig } from "intlayer";import { svelteKitRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ... (diğer ayarlar)  routing: {    mode: "prefix-all",    rewrite: svelteKitRewrite({      "/[locale]/about": {        fr: "/[locale]/a-propos",        es: "/[locale]/acerca-de",      },      "/[locale]/products/[id]": {        fr: "/[locale]/produits/[id]",        es: "/[locale]/productos/[id]",      },    }),  },};export default config;
    intlayer.config.ts
    Kodu kopyala

    Kodu panoya kopyala

    import { Locales, type IntlayerConfig } from "intlayer";import { solidRouterRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ... (diğer ayarlar)  routing: {    mode: "prefix-all",    rewrite: solidRouterRewrite({      "/:locale/about": {        fr: "/:locale/a-propos",        es: "/:locale/acerca-de",      },      "/:locale/products/:id": {        fr: "/:locale/produits/:id",        es: "/:locale/productos/:id",      },    }),  },};export default config;
    intlayer.config.ts
    Kodu kopyala

    Kodu panoya kopyala

    import { Locales, type IntlayerConfig } from "intlayer";import { nuxtRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ...  routing: {    mode: "prefix-all",    rewrite: nuxtRewrite({      "/[locale]/about": {        fr: "/[locale]/a-propos",        es: "/[locale]/acerca-de",      },      "/[locale]/products/[id]": {        fr: "/[locale]/produits/[id]",        es: "/[locale]/productos/[id]",      },    }),  },};export default config;

    Kullanılabilir Formatlayıcılar

    Intlayer tüm popüler framework'ler için formatlayıcılar sağlar:

    • nextjsRewrite: Next.js App Router için. [slug], [...slug] (1+), ve [[...slug]] (0+) destekler.
    • svelteKitRewrite: SvelteKit için. [slug], [...path] (0+), ve [[optional]] (0-1) destekler.
    • reactRouterRewrite: React Router için. :slug ve * (0+) destekler.
    • vueRouterRewrite: Vue Router 4 için. :slug, :slug? (0-1), :slug* (0+), ve :slug+ (1+) destekler.
    • solidRouterRewrite: Solid Router için. :slug ve *slug (0+) destekler.
    • tanstackRouterRewrite: TanStack Router için. $slug ve * (0+) destekler.
    • nuxtRewrite: Nuxt 3 için. [slug] ve [...slug] (0+) destekler.
    • viteRewrite: Herhangi bir Vite tabanlı proje için genel bir formatter. Vite proxy'su için sözdizimini normalleştirir.

    Gelişmiş Desenler

    Intlayer bu desenleri dahili olarak birleşik bir sözdizimine normalleştirir; bu, gelişmiş yol eşleştirme ve oluşturma olanağı sağlar:

    • İsteğe Bağlı Segmentler: [[optional]] (SvelteKit) veya :slug? (Vue/React) desteklenir.
    • Catch-all (Sıfır veya daha fazla): [[...slug]] (Next.js), [...path] (SvelteKit/Nuxt) veya * (React/TanStack) birden fazla segmentle eşleşmeye izin verir.
    • Zorunlu Catch-all (Bir veya daha fazla): [...slug] (Next.js) veya :slug+ (Vue) en az bir segmentin varlığını garanti eder.

    İstemci Taraflı URL Düzeltmesi: useRewriteURL

    Tarayıcı adres çubuğunun her zaman "pretty" (gösterişli) yerelleştirilmiş URL'yi yansıtmasını sağlamak için Intlayer useRewriteURL hook'unu sağlar. Bu hook, kullanıcı kanonik bir yola geldiğinde URL'yi window.history.replaceState kullanarak sessizce günceller.

    Çerçevelerde Kullanım

    tsx
    Kodu kopyala

    Kodu panoya kopyala

    'use client';import { useRewriteURL } from "next-intlayer";const MyLayout = ({ children }) => {  useRewriteURL(); // /fr/about adresini otomatik olarak /fr/a-propos olarak düzeltir  return <>{children}</>;};
    tsx
    Kodu kopyala

    Kodu panoya kopyala

    'use client';import { useRewriteURL } from "react-intlayer";const MyLayout = ({ children }) => {  useRewriteURL(); // Otomatik olarak /fr/about adresini /fr/a-propos'a düzeltir  return <>{children}</>;};
    vue
    Kodu kopyala

    Kodu panoya kopyala

    <script setup>import { useRewriteURL } from "vue-intlayer";useRewriteURL();</script>
    tsx
    Kodu kopyala

    Kodu panoya kopyala

    import { useRewriteURL } from "solid-intlayer";const Layout = (props) => {  useRewriteURL();  return <>{props.children}</>;};
    svelte
    Kodu kopyala

    Kodu panoya kopyala

    <script>import { useRewriteURL } from "svelte-intlayer";useRewriteURL();</script>

    Router Entegrasyonu ve Proxy'ler

    Intlayer'in sunucu tarafı proxy'leri (Vite ve Next.js), SEO tutarlılığını sağlamak için özel yeniden yazmaları otomatik olarak yönetir.

    1. Dahili Yeniden Yazmalar: Bir kullanıcı /fr/a-propos adresini ziyaret ettiğinde, proxy bunu dahili olarak /fr/about adresine eşler, böylece framework doğru rotayla eşleşir.
    2. Yetkili Yönlendirmeler: Bir kullanıcı elle /fr/about yazarsa, proxy /fr/a-propos'a 301/302 yönlendirmesi yapar; böylece arama motorları sayfanın yalnızca tek bir sürümünü dizine ekler.

    Next.js Entegrasyonu

    Next.js entegrasyonu intlayerProxy middleware'i aracılığıyla tamamen yönetilir.

    middleware.ts
    Kodu kopyala

    Kodu panoya kopyala

    import { intlayerProxy } from "next-intlayer/middleware";import { NextRequest } from "next/server";export function middleware(request: NextRequest) {  return intlayerProxy(request);}

    Vite Entegrasyonu

    SolidJS, Vue ve Svelte için intlayerProxy Vite eklentisi geliştirme sırasında yeniden yazmaları (rewrites) yönetir.

    vite.config.ts
    Kodu kopyala

    Kodu panoya kopyala

    import { defineConfig } from "vite";import { intlayerProxy } from "vite-intlayer";export default defineConfig({  plugins: [intlayerProxy()],});

    Temel Özellikler

    1. Çoklu Bağlam Yeniden Yazmaları

    Her formatter, farklı tüketiciler için uzmanlaşmış kuralları içeren bir RewriteObject oluşturur:

    • url: İstemci tarafı URL oluşturma için optimize edilmiştir (locale segmentlerini kaldırır).
    • nextjs: Next.js middleware için [locale] korur.
    • vite: Vite proxy'leri için :locale korur.

    2. Otomatik Pattern Normalizasyonu

    Intlayer, tüm kaynak framework'lerinden bağımsız olarak eşlemenin tutarlı kalmasını sağlamak için tüm desen sözdizimlerini dahili olarak normalleştirir (ör. [param]'ı :param'a dönüştürmek).

    3. SEO için Yetkili URL'ler

    Kanonik yollardan daha okunaklı takma adlara yapılan yönlendirmeleri zorunlu kılarak, Intlayer çoğaltılmış içerik sorunlarını önler ve sitenin bulunabilirliğini artırır.

    Temel Yardımcı Fonksiyonlar

    • getLocalizedUrl(url, locale): Yeniden yazma kurallarına uyan yerelleştirilmiş bir URL üretir.
    • getCanonicalPath(path, locale): Yerelleştirilmiş bir URL'yi dahili kanonik yoluna çözer.
    • getRewritePath(pathname, locale): Bir yol adının daha okunaklı yerelleştirilmiş takma adına düzeltilmesi gerekip gerekmediğini tespit eder.
    Neden Intlayer?
    Alt+→

    Bu sayfada

      Tartışmalar anonimdir ve yaygın sorunları ele almak için düzenli olarak incelenir. Özellik fikirleri, belgeleme hakkında geri bildirimler veya Intlayer ile ilgili herhangi bir şeyi paylaşmaktan çekinmeyin, bu girdileri yol haritamızı şekillendirmek ve ürünü geliştirmek için kullanıyoruz.

      import { Locales, type IntlayerConfig } from "intlayer";import { nextjsRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ...  routing: {    mode: "prefix-no-default",    rewrite: nextjsRewrite({      "/[locale]/about": {        fr: "/[locale]/a-propos",        es: "/[locale]/acerca-de",      },      "/[locale]/products/[id]": {        fr: "/[locale]/produits/[id]",        es: "/[locale]/productos/[id]",      },    }),  },};export default config;
      import { Locales, type IntlayerConfig } from "intlayer";import { reactRouterRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ...  routing: {    mode: "prefix-all",    rewrite: reactRouterRewrite({      "/:locale/about": {        fr: "/:locale/a-propos",        es: "/:locale/acerca-de",      },      "/:locale/products/:id": {        fr: "/:locale/produits/:id",        es: "/:locale/productos/:id",      },    }),  },};export default config;
      import { Locales, type IntlayerConfig } from "intlayer";import { tanstackRouterRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ...  routing: {    mode: "prefix-all",    rewrite: tanstackRouterRewrite({      "/$locale/about": {        fr: "/$locale/a-propos",        es: "/$locale/acerca-de",      },      "/$locale/products/$id": {        fr: "/$locale/produits/$id",        es: "/$locale/productos/$id",      },    }),  },};export default config;
      import { Locales, type IntlayerConfig } from "intlayer";import { vueRouterRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // diğer ayarlar  routing: {    mode: "prefix-all",    rewrite: vueRouterRewrite({      "/:locale/about": {        fr: "/:locale/a-propos",        es: "/:locale/acerca-de",      },      "/:locale/products/:id": {        fr: "/:locale/produits/:id",        es: "/:locale/productos/:id",      },    }),  },};export default config;
      import { Locales, type IntlayerConfig } from "intlayer";import { svelteKitRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ... (diğer ayarlar)  routing: {    mode: "prefix-all",    rewrite: svelteKitRewrite({      "/[locale]/about": {        fr: "/[locale]/a-propos",        es: "/[locale]/acerca-de",      },      "/[locale]/products/[id]": {        fr: "/[locale]/produits/[id]",        es: "/[locale]/productos/[id]",      },    }),  },};export default config;
      import { Locales, type IntlayerConfig } from "intlayer";import { solidRouterRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ... (diğer ayarlar)  routing: {    mode: "prefix-all",    rewrite: solidRouterRewrite({      "/:locale/about": {        fr: "/:locale/a-propos",        es: "/:locale/acerca-de",      },      "/:locale/products/:id": {        fr: "/:locale/produits/:id",        es: "/:locale/productos/:id",      },    }),  },};export default config;
      import { Locales, type IntlayerConfig } from "intlayer";import { nuxtRewrite } from "intlayer/routing";const config: IntlayerConfig = {  // ...  routing: {    mode: "prefix-all",    rewrite: nuxtRewrite({      "/[locale]/about": {        fr: "/[locale]/a-propos",        es: "/[locale]/acerca-de",      },      "/[locale]/products/[id]": {        fr: "/[locale]/produits/[id]",        es: "/[locale]/productos/[id]",      },    }),  },};export default config;
      'use client';import { useRewriteURL } from "next-intlayer";const MyLayout = ({ children }) => {  useRewriteURL(); // /fr/about adresini otomatik olarak /fr/a-propos olarak düzeltir  return <>{children}</>;};
      'use client';import { useRewriteURL } from "react-intlayer";const MyLayout = ({ children }) => {  useRewriteURL(); // Otomatik olarak /fr/about adresini /fr/a-propos'a düzeltir  return <>{children}</>;};
      <script setup>import { useRewriteURL } from "vue-intlayer";useRewriteURL();</script>
      import { useRewriteURL } from "solid-intlayer";const Layout = (props) => {  useRewriteURL();  return <>{props.children}</>;};
      <script>import { useRewriteURL } from "svelte-intlayer";useRewriteURL();</script>
      import { intlayerProxy } from "next-intlayer/middleware";import { NextRequest } from "next/server";export function middleware(request: NextRequest) {  return intlayerProxy(request);}
      import { defineConfig } from "vite";import { intlayerProxy } from "vite-intlayer";export default defineConfig({  plugins: [intlayerProxy()],});