Jump to content

Problems with .htaccess options FollowSymLinks and SymLinksifOwnerMatch – are they really needed?


nurkka
 Share

Recommended Posts

I often have problems with the ProcessWire .htaccess file. As my clients are using different hosting providers and I am working with DDEV locally, I have to deal with htaccess issues very often. The main problem seems to be the directive `Options +FollowSymLinks` and `Options +SymLinksifOwnerMatch`, but sometimes also the other options, which are marked as error 500 critical in the ProcessWire htaccess file. Currently, I have a project with two different htaccess files, because the staging and production server allow and deny different options.

- Is `Options +FollowSymLinks` or `Options +SymLinksifOwnerMatch` really needed? Or can they be omitted?

 

Link to comment
Share on other sites

Both directives are needed if you have symlinks in your setup, which will be the case if you use RockMigrations deployments for example. If you don't have any symlinks I guess you could remove them, but I'm not sure if anything else needs them.

I don't have any problems with DDEV.

Link to comment
Share on other sites

Thanks @bernhard , for the info, that RockMigrations deployments are using symlinks. I am using RockMigrations but not RockMigrations deployments (yet).
So if ProcessWire doesn't use symlinks, I could simply comment out those two symlink directives and would have only one version of my .htaccess to maintain.
Do you or does anybody know if ProcessWire itself uses symlinks?

Link to comment
Share on other sites

11 minutes ago, nurkka said:

So if ProcessWire doesn't use symlinks, I could simply comment out those two symlink directives and would have only one version of my .htaccess to maintain.
Do you or does anybody know if ProcessWire itself uses symlinks?

Or something like this? (untested, never used)

<If "%{HTTP_HOST} == 'foo.ddev.site'">
    Options +FollowSymLinks
</If>
<Else>
    Options +SymLinksifOwnerMatch
</Else>

 

Link to comment
Share on other sites

On 11/6/2024 at 5:40 PM, bernhard said:

Both directives are needed if you have symlinks in your setup, which will be the case if you use RockMigrations deployments for example. If you don't have any symlinks I guess you could remove them, but I'm not sure if anything else needs them.

I don't have any problems with DDEV.

I am seeing the same as OP on many of our hosting partners: Some just won't allow you to use FollowSymlinks. Ever. This renders your plugin unusable on these installations. You should maybe mention this in your docs somewhere...

Link to comment
Share on other sites

Well, what I mean is that your deployments function won't work on any installation which needed the .htaccess edited (= comment out FollowSymlinks line) for ProcessWire to run properly. If you are checking for symlink function and work around it if it's not available, I retract everything I said :).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...