17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1263 Views |
-
Including non-Silverstripe content.

10 May 2008 at 4:24pm Last edited: 10 May 2008 4:25pm
Hi I've got a bunch of non-silverstripe content which I want to add to a site.
I don't see how to convert it easily, so I would like to just use it "as it is" with php & css in a sub-directory, well in the meantime anyway.
The problem is, I'm not sure how to do it as the silverstripe stuff doesn't allow direct access to a file in a sub-directory.
So when I add the directory name to the URL, the silverstripe is looking for a CMS-generated page with that name
I'm sure there is a way ... but it's got me beat.
//Bruce -
Re: Including non-Silverstripe content.

10 May 2008 at 5:08pm
The .htaccess file is designed to serve up a static file if a file is requested. If a file with the given URL exists, such as mysite/css/layout.css, this will work fine. However, if you try and access a directory, it doesn't work like this.
A potential solution is to update the .htaccess file. I haven't tested this, so good luck, and let us all know how it goes.
There's a block like this:
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
### SILVERSTRIPE END ###Try changing it to this:
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
### SILVERSTRIPE END ### -
Re: Including non-Silverstripe content.

10 May 2008 at 5:34pm
With that condition
RewriteCond %{REQUEST_FILENAME} !-d
you gave access to all subfolders.
If you only want one folder accessable you could try this condition in your .htaccess
RewriteCond %{REQUEST_URI} !/foldername
-
Re: Including non-Silverstripe content.

11 May 2008 at 4:47pm Last edited: 11 May 2008 4:48pm
A bit of quiet checking goes a long way...
The directory name I was using was the same as the URI of a re-director page, that I had created earlier, so it all started to work once I re-named the re-director.
The solution below (specifically opening the directory) would have worked, but I don't want to allow directory listings to be available either.
The specific file names in a directory which doesn't conflict with others are now offering up nicely.Thanks for the suggestions though
| 1263 Views | ||
|
Page:
1
|
Go to Top |



