Question

I downloaded Restler3 a few days ago and while tinkering with it, I decided it was a good idea to move the 'vendor' folder outside site root. At first everything seemed fine, but then I noticed that for example the /math/sum/* example didn't work anymore (as shown here : http://restler3.luracast.com/examples/_002_minimal/readme.html

Ok, so instead of moving it outside the root folder, i moved it in a subfolder, and strangely enough the same result. url's that are like api.domain.com/math/sum/1/2/3/4 that take a variable amount of parameters, just stop working, until i put the 'vendor' folder back in the site root.

Now this may be obvious why to some of you, to me it is not. I always write code that never relies on it's location relatively to something else in order to prevent incompatibilities. The code from Restler looks solid enough so I can't imagine they didn't do the same thing.

Is it maybe something on my server? Is it perhaps something with the advised .htaccess? (I always hated those as I don't really fully understand them)

The .htaccess looks like this :

DirectoryIndex index.php
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^$ index.php [QSA,L]
    RewriteCond %ˆ{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

Can someone maybe shed some light on this for me please, ie enlighten me? I just can't figure it out.

Was it helpful?

Solution

vendor folder need not be and should not be on the publicly accessible.

when you move vendor folder make sure you move composer.json along and run

composer dump-autoload

to make sure the autoload.php is upto date

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top