# GitHub Pages ile Apex domain desteklemeyen bir siteye yönlendirme yapmak

<figure><img src="/files/qJqNJ0Smg7zTbN9IRtkl" alt=""><figcaption></figcaption></figure>

## **GitHub Üzerinden Bir Repo Açın**

* Repoyu açtıktan sonra aşağıdaki dosyaları ekleyin:

<details>

<summary><code>index.html</code> Asıl yönlendirme için <code>URLINIZI BURAYA YAZIN</code> kısmını düzenlemeyi unutmayın.</summary>

```html
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="refresh" content="0;url=https://www.yemreak.com" />
		<title>Yönlendirme</title>
		<style>
			body {
				font-family: "Arial", sans-serif;
				height: 100vh;
				margin: 0;
				display: flex;
				justify-content: center;
				align-items: center;
				background-color: #f5f5f5;
			}
			.container {
				text-align: center;
				animation: fade 2s;
			}
			@keyframes fade {
				0% {
					opacity: 0;
					transform: translateY(30px);
				}
				100% {
					opacity: 1;
					transform: translateY(0);
				}
			}
			.spinner {
				border: 8px solid rgba(255, 255, 255, 0.3);
				border-radius: 50%;
				border-top: 8px solid #333;
				width: 60px;
				height: 60px;
				animation: spin 1s linear infinite;
				margin: 0 auto 20px;
			}
			@keyframes spin {
				0% {
					transform: rotate(0deg);
				}
				100% {
					transform: rotate(360deg);
				}
			}
		</style>
	</head>
	<body>
		<div class="container">
			<div class="spinner"></div>
			Yönlendiriliyorsunuz... Eğer yönlendirme otomatik olarak gerçekleşmezse,
			<a href="https://www.yemreak.com">tıklayın</a>.
		</div>
		<script type="text/javascript">
			// Mevcut URL'den slug'ı al
			var currentSlug = window.location.pathname

			// Yönlendirme yapılacak URL'i oluştur
			var newBaseURL = "URLINIZI BURAYA YAZIN"
			var newURL = newBaseURL + currentSlug

			// 2 saniye sonra oluşturulan yeni URL'e yönlendirme yap
			setTimeout(function () {
				window.location.href = newURL
			}, 2000)
		</script>
	</body>
</html>
```

</details>

<details>

<summary><code>404.html</code> <code>Slug</code> yönlendirmelerinde hata olursa bu dosya kullanılacak ve yönlendirme yapılacak.</summary>

```html
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<title>Yönlendirme</title>
	</head>
	<body>
		<script type="text/javascript">
			// Slug'ı al
			const slug = window.location.pathname
			// Yönlendirme yapılacak URL'i oluştur
			const newURL = `URLINIZI BURAYA YAZIN/${slug}`
			// Yönlendir
			window.location.href = newURL
		</script>
	</body>
</html>
```

</details>

***

![7vBusDB.png](https://i.imgur.com/7vBusDB.png)

## **Domain Servis Sağlayıcınızdan DNS Ayarlarını Yapın**

* Ben Google Domains kullandığımdan **`DNS`** ayarlarından **`Custom records`** kısmına ekleme yapıyorum:
  * **`Host Name`** için subdomain seçenekleri (www, lib, help …)
  * **`Type`** için **`CNAME`** seçeneği ve
  * **`Data`** için **`username.github.io`** bilgilerinizi girin.

    ![pVWC6YX.png](https://i.imgur.com/pVWC6YX.png)
* Eğer Apex domain yapacaksanız:
  * **`Host Name`** kısmını boş bırakın.
  * **`Type`** için **`A`** seçeneğini seçin.
  * **`Data`** için 4 adet IP adresi ekleyin.

    ![Untitled.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/ee37cc61-925f-4001-b016-3854758f2639/3f036f47-2b92-4f53-8887-9103ef744310/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256\&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD\&X-Amz-Credential=AKIAT73L2G45EIPT3X45%2F20231029%2Fus-west-2%2Fs3%2Faws4_request\&X-Amz-Date=20231029T012449Z\&X-Amz-Expires=3600\&X-Amz-Signature=0f6bb6500e2edc6e00de304b439ee3919720182ba81fbfff2b9c541b44d7cbc6\&X-Amz-SignedHeaders=host\&x-id=GetObject)

***

<div align="center"><img src="https://i.imgur.com/AgVEfpc.png" alt="AgVEfpc.png"></div>

## **GitHub Reposunu GitHub Pages ile Yayınlayın**

* **`Settings`** ⇒ **`Pages`** ⇒ **`Custom Domain`** kısmına domain bilginizi girin:

  * Apex domain için **`[yemreak.com](http://yemreak.com)`** şeklinde girebilirsiniz.

  ![M4gs7uM.png](https://i.imgur.com/M4gs7uM.png)

  ![Gj3SUuL.png](https://i.imgur.com/Gj3SUuL.png)
* **`DNS`** onaylandıktan sonra **`CNAME`** isimli bir dosya repoya eklenecek ve yönlendirme tamamlanacak.

<figure><img src="/files/LFRY40Ugj3nW7x0HuOH0" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yemreak.com/arsiv/programming/github-pages-ile-apex-domain-desteklemeyen-bir-siteye-yonlendirme-yapmak.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
