Search

This isn't exactly about Symphony, but I figured y'all would have a better understanding of the Symphony-generated htaccess file than others. .htaccess (and mod_rewrite) is still somewhat black magic-ish to me, so I'm not sure what to add or change to get this to work.

I’m trying to verify my ownership of my domain on [keybase.io], which requires allowing a file at {$root}/.well-known/keybase.txt. The default htaccess rules just makes the whole folder 403 forbidden. Help?

I don't really understand what you're asking, but any folder with a . at the start is automatically hidden by Linux.

All dotfiles and dotfolders are.

I think you should be able to put a .htaccess file in the .well-known directory containing the following to exclude the directory from the rewrite engine.

RewriteEngine Off

Edit: it seems Apache does serve files that are in hidden/dot directories, so you should be okay there.

The Symphony rule that causes issues for you is:

RewriteRule (^|/). - [F]

which basically works for everything starting with a dot. I think that his rule generally a good thing.

You shouldn't edit or remove this line, because Symphony might change its .htaccess rules, e.g. during an upgrade. So you shouldn't touch anything inside the Symphony block of your .htaccess file.

However, you can add you own rules before the Symphony block. The following, for example, would rewrite .well-known/ URLs to themselves and the use the L flag which says that this is the last to be applied here:

RewriteRule ^.well-known/(.*)$ .well-known/$1 [L]

I am not sure if this is the most elegant way though.

@DavidOliver's suggestion probably is more elegant than mine. :-)

I think that his rule generally a good thing.

I agree, and was a little surprised that Apache serves hidden files. I suppose there are points for and against, but I think the default behaviour should be as Symphony sets it via that .htaccess rule.

@DavidOliver’s brilliantly simple solution worked, thank you!

And It means I don’t have to worry about .htaccess be overwritten in an update, which I completely forgot about. Thanks, all.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details