Search code examples
githubhttp-redirectgithub-pagescname

How do I cancel GitHub Pages redirection?


I created a web page using GitHub Pages. I added the custom domain by following the Settings>Pages path. The page redirect was successfully performed by creating the CNAME file.

enter image description here

I wanted to cancel the page redirect after a while. Therefore I removed the CNAME file and followed all the steps mentioned in the documents. But I was not able to cancel the page redirect. How can I fix this problem?


Solution

  • Since the website redirect is saved in the browser's cache, the redirect will continue even if the redirect is cancelled via the Settings>Pages tab on GitHub; this will automatically cause the CNAME file to be deleted. The way to solve this problem:

    1. Remove the previous redirect by going to Settings>Pages on GitHub.
    2. Rebuild the page via the Actions tab on GitHub.
    3. Click the F12 while the browser is open.
    4. Long click on the refresh button on the browser.
    5. Select the Empty Cache and Hard Reload option.

    enter image description here

    When you try to enter the website again, you will see that the redirect has been cancelled.