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.

Hosting Requirements /

What you need to consider when choosing a hosting provider and plan.

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

Update to Working Webhosts (Openhost - New Zealand)


Go to End


6 Posts   4237 Views

Avatar
toherangi

Community Member, 3 Posts

16 August 2010 at 9:36pm

Edited: 16/08/2010 9:36pm

Kia ora all,

Just an update on the known working webhosts list at http://doc.silverstripe.org/suggested-web-hosts#working_webhosts

I have linux hosting with Openhost in New Zealand. I had a few hiccups to start with but with assistance from DesignCity and AJShort on the #silverstripe IRC channel, they have been ironed out nicely!

If you get hosting with Openhost, just keep the following in mind...
1) You will need to email Openhost Support and have them

  • Turn Off PHP Safe Mode (On by default)
  • Turn On mod_rewrite
  • Turn Off mbstring.function_overload

2) You will also need to create your .htaccess file manually, and saving in ascii format.

### SILVERSTRIPE START ###
<Files *.ss>
	Order deny,allow
	Deny from all
	Allow from 127.0.0.1
</Files>

<Files web.config>
	Order deny,allow
	Deny from all
</Files>

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /

	RewriteCond %{REQUEST_URI} ^(.*)$
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
### SILVERSTRIPE END ###

Cheers to DesignCity and AJShort for their help!
Chur!

Avatar
Aioli

Community Member, 10 Posts

10 December 2010 at 11:17am

Kia Ora Toherangi!
Thank you for your great post about Openhost & SS. I have got Openhost to make the changes you suggested but I'm a bit stuck as to how to implement the htaccess file changes. I've changed the file on my local server but how do I do that on the remote server? I'll try to get help from Openhost also.
Cheers!
Ailie

Avatar
Aioli

Community Member, 10 Posts

10 December 2010 at 1:07pm

I managed to update and upload the .htaccess file. But I still get this coming up on my site:

Website Error
There has been an error
The website server has not been able to respond to your request.

hmmm

Avatar
toherangi

Community Member, 3 Posts

27 March 2011 at 6:45pm

Sorry Aioli, are you still having this problem?
I didn't subscribe to this post so wasn't notified of your response.

Avatar
mhdesign

Community Member, 216 Posts

9 December 2013 at 10:30am

Edited: 09/12/2013 10:32am

I normally provide hosting services through a Christchurch-based ISP, which has provided me with good service for a number of years. This includes some SilverStripe sites, which I have uploaded and which have performed as expected, including having search-engine-friendly URLs. I have just uploaded a new site to an OpenHost account opened by a client who prefers to use this provider. And this is the first time I've had issues with mod_rewrite/search-engine-friendly URLs for a hosted site (my local development environment is another story - frustrating but I can live without this feature... )

I've read this post and updated my htaccess file in line with Toherangi's original post. I've also checked with OpenHost who have just advised me that the following requirements are met on the server:

1. Turn Off PHP Safe Mode (On by default)
2. Turn On mod_rewrite
3. Turn Off mbstring.function_overload

I still don't have search-engine-friendly URLs. The view from OpenHost is that 'Writing sites and managing CMS is not part of the service we offer'. Is this an issue with Hosting, the SilverStripe CMS or my code? And if it's down to my code, how do I fix it?

Avatar
mhdesign

Community Member, 216 Posts

9 December 2013 at 11:18am

Got it!!

I had to (manually) place the following .htaccess file in the /httpdocs/ (site root) directory

### SILVERSTRIPE START ###
<Files *.ss>
	Order deny,allow
	Deny from all
	Allow from 127.0.0.1
</Files>

<Files web.config>
	Order deny,allow
	Deny from all
</Files>

# This denies access to all yml files, since developers might include sensitive
# information in them. See the docs for work-arounds to serve some yaml files
<Files *.yml>
	Order allow,deny
	Deny from all
</Files>

ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html

<IfModule mod_alias.c>
	RedirectMatch 403 /silverstripe-cache(/|$)
	RedirectMatch 403 /vendor(/|$)
	RedirectMatch 403 /composer\.(json|lock)
</IfModule>

<IfModule mod_rewrite.c>
	SetEnv HTTP_MOD_REWRITE On
	RewriteEngine On
	RewriteBase '/'

	RewriteCond %{REQUEST_URI} ^(.*)$
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_URI} !\.php$
	RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
### SILVERSTRIPE END ###

That fixed it!