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

Fasthosts


Go to End


10 Posts   9326 Views

Avatar
bones

Community Member, 110 Posts

25 November 2010 at 11:06pm

Still struggling with Fasthosts!

Just had this reply from them:

"Unfortunately we are unable to provide support on scripting issues. But in my past experience most Mod rewriting issues on our system are cause due to the developer trying to turn it on re-writing modules when using .htaccess files. On our system there is no need to turn the rewriting engine on and off or to tell the server to enable options as All these options are on by default. Calling engine on will cause the site to error, most re-writing functionality is possible on our system."

Can anybody offer any suggestions about what this actually means?

Avatar
stew

Community Member, 30 Posts

9 December 2010 at 3:12am

Edited: 09/12/2010 3:12am

For those still having issues with Fasthosts I have finally managed to deploy two Silverstripe powered sites on their Linux Shared Hosting platform - it was a big headache but everything is now working.

There are two steps involved, one is an amendment to the Core.php file courtesy of Matty Balaam in this thread.

Amendment to the bottom of /sapphire/core/Core.php

/** 
* Increase the time limit of this script. By default, the time will 
be unlimited. 
* @param $timeLimit The time limit in seconds. If omitted, no time 
limit will be set. 
*/ 
function increase_time_limit_to($timeLimit = null) { 
if(!ini_get('safe_mode')) { 
if(!$timeLimit) { 
} else { 
$currTimeLimit = ini_get('max_execution_time'); 
if($currTimeLimit && $currTimeLimit < $timeLimit) { 
} 
} 
} 
}

?>

Step two is the alteration of various .htaccess files. Fasthosts seem to be preventing anything but mod_rewrite rules from being used in .htaccess files, so the main .htaccess in the root is below:

# Use PHP5 as default 
#AddHandler application/x-httpd-php5 .php

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

<IfModule mod_rewrite.c> 
RewriteEngine On

RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)|(\.php$)

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

You will need to comment out the deny/allow rules in cms/.htaccess and sapphire/.htaccess

Hope that helps. The biggest suggestion I'd give is host elsewhere but I was stuck with a client who had already paid for a full year of hosting with Fasthosts... :S

Go to Top