Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Folder not-connected to SS


Go to End


10 Posts   2144 Views

Avatar
Maariak

Community Member, 37 Posts

11 August 2015 at 10:55pm

I've worked with a site quite a long time ago. I had one folder in the server that wasn't connected to Silverstripe. I tried to add another folder like that (folder that is secured with .htaccess and .htpasswd -files), but I remember there was somethings that should be done for some file, to get that folder work on it's own. But I don't remember what. And because english isn't my native language, I can't find the right words to search for an answer. Could someone help me with my problem.

Avatar
Pyromanik

Community Member, 419 Posts

11 August 2015 at 11:32pm

Edited: 11/08/2015 11:33pm

You'll need to refactor the rewriterules (or add an exception before the SS ones) to allow the request to go directly into the folder rather than to silverstripe's main.php. This is in the installation root .htaccess

css, js, image etc. files are already allowed for, but if you want to access some other kind of file, you must add an exception (eg. to execute PHP).

There's not really anything else other than that (that I can think of at least).

Avatar
Maariak

Community Member, 37 Posts

12 August 2015 at 12:13am

I'm not sure if I understood. So I should have .htaccess in my root folder? I search for the files and there is htaccess-file in sapphire-file, which is under the root file. But I don't know why I can't get the file visible. I need to check if there is some thing in my ftp-program why it isnt shown. (It's so hard to try to write about these thing with my bad english, not enough right words in my head :P )

Avatar
Maariak

Community Member, 37 Posts

12 August 2015 at 12:23am

Ok, now I got the htaccess-file shown, also in the root file. And in that folder, that is working on it's own, without silverstripe. In that htaccess-file there's just.

<IfModule mod_rewrite.c>
RewriteEngine Off
</IfModule>

That working folder isn't protected by password.

I put this htaccess also to the new folder, that should be protected by password (and there's also .htpasswd-file) It does ask the password when trying to get to the page, but after clicking ok, it says "Sorry, there was a problem with handling your request." So that problem may not be about silverstripe-things anymore?

Avatar
Pyromanik

Community Member, 419 Posts

12 August 2015 at 12:51am

.htaccess are executed for each folder in the tree.
If you put the that .htaccess into your folder, SilverStripe's will be executed first, and try to handle the request. You need to modify the one in the silverstripe installation root.

website/.htaccess <-- this one.
website/framework
website/cms
...
website/yourfolder/.htaccess <-- this is where your .htpasswd or whatever will be

Avatar
Maariak

Community Member, 37 Posts

12 August 2015 at 6:57am

Do I need to write name of this "myfolder" to somewhere in that htaccess-file in the root directory?

Avatar
Maariak

Community Member, 37 Posts

20 October 2015 at 10:12pm

This problem still isn't solved. Could someone kindly point some easy step-by-step guide how this should be done, what should be add to which folder/file?

Avatar
Maariak

Community Member, 37 Posts

23 October 2015 at 11:15pm

I read another topic where someone was installilg wordpress-blog in the subfolder under silverstripe. In that topic was written
"The Wordpress subfolder I created was named /blog so I added the following line into my .htaccess file:

RewriteCond %{REQUEST_URI} !/blog

Everything seems to be working now"

I tried that too, but still I don't know how I should get the subfolder work as "blank", without silverstripe involved :/

Go to Top