Jump to content

Stu Friedberg

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Stu Friedberg

  1. I am using acme.sh with the webroot validation mode and don't have an issue with https for renewal. However, I put this in my .htaccess in case I ever have to start from scratch. RewriteCond %{HTTP:X-Forwarded-Proto} =http RewriteCond %{REQUEST_URI} "!(^|/)\.well-known" RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] The interesting bit is the 2nd line, which effectively says "to redirect from http to https, the URI cannot match .well-known or anything/.well-known". In the PW-installed .htaccess this is the #9 block of directives that redirects from http to https, not the #12 block of access control restrictions. The sense of the comparison with ".well-known" here is different than in block #12. Additionally, the exact format of the 1st line will depend on how your web server frontend/load-balancer is configured. Alternatives involve %{HTTPS}, %{HTTP:X-Forwarded-SSL}, %{HTTP:Forwarded}, etc, and you should not change whatever is already working for you in the 1st line.
  2. I am in the process of converting a 14-year-old homebrew photo gallery CMS into ProcessWire as my first PW project. The original was based on nicely normalized SQL tables, with a photo id being used as a foreign key across auxiliary tables like "description", "notes", "keywords", etc. I've completed the first phase of the conversion by treating original SQL tables as PW page tree nodes, with original SQL records as PW child leaf pages under the corresponding table parent page. The leaf pages are named for the original key value. Where the original schema used non-unique keys, I am using Repeaters on a single page. This went pretty smoothly. My existing "database access" layer in hand-written PHP becomes a much lighter wrapper in PW, and could disappear entirely if I feel motivated to rewrite all the other PHP client code which uses it. Before I proceed to the second phase (capturing all the directly managed photo files as PW PageImages and converting the original keyword records into PW file tags), I'd like to ask about PW best practices and my first phase conversion. None of the auxiliary data is especially large, perhaps 40 to 200 characters when present. However, it can be quite sparse; most photos have no notes, for example. Is it "better" to fold all the possible data fields into a single page template (denormalization), or are there still DB advantages to retaining the separation based on a raw SQL table schema? I suppose I am interested in both technical and cultural answers to that question.
×
×
  • Create New...