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.

Customising the CMS /

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

Use standalone PHP in a subdirectory


Go to End


19 Posts   6925 Views

Avatar
Double-A-Ron

Community Member, 607 Posts

15 April 2009 at 2:42pm

Should be a pretty simple one:

I've got a directory that I have dropped into my Silverstripe root directory called "custom". In this directory, I have a php page called index.php, amongst others.

Obviously, when I try to open www.domain.com/custom/, The SS rewrite engine kicks in and tries to find a CMS page that doesn't exist.

How can I modify this behavior on a per directory basis?

And, no, I don't want to use a redirector page either. These pages are all process pages and I don't want them in the SiteTree.

Cheers
Aaron

Avatar
Nivanka

Community Member, 400 Posts

15 April 2009 at 3:00pm

I think you can access the page with the actual URL to the file.
Something like this I mean www.domain.com/custom/index.php

Avatar
Double-A-Ron

Community Member, 607 Posts

15 April 2009 at 4:24pm

Edited: 15/04/2009 4:25pm

Er, that would have been the first thing I tried to actually find this problem in the first place, don't you think?

No, that doesn't work obviously. I'm told that the page doesn't exisit, which is the CMS throughing it's page-not-found handler.

Avatar
Ben Gribaudo

Community Member, 181 Posts

16 April 2009 at 12:25am

What's your .htaccess file look like?

Avatar
briso

Community Member, 1 Post

18 May 2009 at 10:17am

I'm new to SS.

I'm trying to get a Virtual Tour based around PHP script going. It runs as per normal on various other sites/hosting.

It's sitting in a directory/folder outside SS but when it runs it just displays the generated HTML code.

Even simple Hello World or phpinfo.php script does the same.

I've found some info within this forum which indicates the SS processes everything delivered from the site even if it's external to SS, but I can't find a definitive procedure to have PHP run normally as it does on non SS sites.

Does the answer lie in a mod to php.ini , .htaccess , SS or anywhere else?

Can anyone point me in the right direction?

Avatar
Ingo

Forum Moderator, 801 Posts

2 June 2009 at 10:08am

If you include a file called "__manifest_exclude" in a folder, SilverStripe will ignore it.

Avatar
SilverRay

Community Member, 167 Posts

2 June 2009 at 1:16pm

Hmm. If I have a directory called "haha" in root, and a file in it called "__manifest_exclude", the url http://www.mydomain.com/haha/ still goes to Silverstripe's error page... also when I name the file "_manifest_exclude" with one underscore as is described here: http://doc.silverstripe.com/doku.php?id=changelog&s=manifest%20exclude

Bug maybe? Using version SS 2.3.1

Avatar
rbquirke

Community Member, 70 Posts

3 June 2009 at 10:43am

No, this is not a bug.

What Ingo was talking about prevents the php from being included into the SilverStripe codebase.
If you want to actually access that directory directly, you will need to tell .htaccess not to use the Silverstripe for that directory.

You need to add line to your .htaccess file like:
RewriteCond %{REQUEST_URI} !/directoryname

where directoryname is the name of the directory with your files

Go to Top