shahramatrian
shahramatrian

Hi. I'm migrating a websie and one of my concerns is to password protect some pages. Those pages have been password protected by Apache basic authentication, however it seems it's not possible to do the same with OctoberCMS.

On the original website, the pages are two index.html pages under different subfolder like:

  • help/ABC/index.html
  • help/XYZ/index.html I think I can't password protect the files via httpd.conf or .htaccess because of how OctoberCMS routes the pages to local files.

Actually I tried to limit access to the page like this:

<FilesMatch "index.html">
    AuthName "Username and password required"
    AuthUserFile <path-to-password-file>
    Require valid-user
    AuthType Basic
</FilesMatch>

But although it works for index.html as the home page, it doesn't for index.html files located on subfolders. (BTW, I have added .html to the end of page URLs for SEO purposes).

The problem is .htaccess file must be located in the same subfolder to work, but when I create a new .htaccess in related subfolder it doesn't work.

I also need to add that each page can be opened by same username but different passwords, which doesn't allow me to use OctoberCMS access control tools.

I appreciate any help.

Last updated

shahramatrian

1-2 of 2