Is there an alternative to .htaccess for GitHub Pages?

前端 未结 4 754
天涯浪人
天涯浪人 2020-12-09 14:24

I understand that .htaccess is not supported by GitHub Pages. Is there an alternative for password-protecting particular directories for websites hosted by GitH

4条回答
  •  轮回少年
    2020-12-09 15:20

    This post comes out at the top of web search when you look for .htaccess redirects in github pages. I am going to answer this question in that sense.

    One option is to use a DNS redirect instead. You do this by putting a file named CNAME in the project's root directory (not sure if it works in a subdirectory). Just put the redirection URL in the file. However, there are a few limitations, e.g. you can only redirect to a website's root.

提交回复
热议问题