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

Full Solution for Zeus Server Hosting!!


Go to End


5 Posts   3334 Views

Avatar
neilcreagh

Community Member, 136 Posts

27 October 2010 at 6:23am

Ok I've finally got a Silverstripe website to behave properly on a Namesco Zeus Server ( Register365 here in Ireland ) with teh help of a lot of individual posts on this forum and some playing around, so I thought I should post the final solutions here for anyone that might be stuck trying to get mod_rewrite working on a Zeus server.

Firstly - put this code into a file named rewrite.script in the root of your site:

RULE_0_START:
# get the document root
map path into SCRATCH:DOCROOT from /
# initialize our variables
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}

# see if theres any queries in our URL
match URL into $ with ^(.*)\?(.*)$
if matched then
  set SCRATCH:REQUEST_URI = $1
  set SCRATCH:QUERY_STRING = $2
endif
RULE_0_END:

RULE_1_START:
# prepare to search for file, rewrite if its not found
set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}

# check to see if the file requested is an actual file or
# a directory with possibly an index.  don't rewrite if so
look for file at %{SCRATCH:REQUEST_FILENAME}
if not exists then
  look for dir at %{SCRATCH:REQUEST_FILENAME}
  if not exists then
    set URL = /sapphire/main.php?url=%{SCRATCH:REQUEST_URI}
    goto QSA_RULE_START
  endif
endif

# if we made it here then its a file or dir and no rewrite
goto END
RULE_1_END:

QSA_RULE_START:
# append the query string if there was one originally
# the same as [QSA,L] for apache
match SCRATCH:ORIG_URL into % with \?(.*)$
if matched then
  set URL = %{URL}&%{SCRATCH:QUERY_STRING}
endif
goto END
QSA_RULE_END:

Then, I had a problem where index.php kept getting added to the links on the homepage only - and solved this by opening the index.php file and changing the BASE_SCRIPT_URL from

 define('BASE_SCRIPT_URL','index.php/'); 

to
 define('BASE_SCRIPT_URL',''); 

Hope this helps,
Neil

Avatar
Ingo

Forum Moderator, 801 Posts

16 December 2010 at 10:30pm

Great to see that SilverStripe can be bent to run on other webserver platforms as well!
Do you have any arguments for Zeus Server over other platforms, just out of interest?

Avatar
neilcreagh

Community Member, 136 Posts

16 December 2010 at 10:53pm

Not really. I still seem to have a small issue where I have to log-in twice (first log-in takes me into Silverstripe but then selecting a page asks me to log-in again) after that everything seems to run very smoothly though.

So I would still recommend avoiding Zeus where possible.

Avatar
pinkp

Community Member, 182 Posts

18 October 2011 at 10:09am

Edited: 20/10/2011 2:19am

I have tried this with no success. Could you please help.
I am installing on a Zeus server with Namesco and it is quickly draining my time and patience!
I managed to install it with out any changes but this then meant the rewrite was not working and the links kept reading /index.php/mypage and the log in kept logging out and saying I was not the admin. So I am trying a fresh install.

I have:

* Removed .htaccess file
* Added rewrite.script file with your code (although it still states "I can't tell whether any rewriting module is running. You may need to configure a rewriting rule yourself.")
*Changed Index.php to read: define('BASE_SCRIPT_URL','');

The MySQL is only 4.1.22-log does that matter?

Now when I click install it gets stuck at:
"Building database schema..."

any help appreciated thanks!!!

---------
EDIT:

I upgraded the MySQL to 5 and it still freezes....

----------

---------

EDIT:

I think it may be the "AllowOverride All" is not set up and the host will not do this...
What can I do now....?

--------

EDIT:

OK, so deleted and re-uploaded SS and made all the changes above and this time it worked. It did not freeze and the rewrite rule seems to be fine. The host was not able to set the allow override all but at the moment this is fine.

thanks for your reply.

----------

Avatar
neilcreagh

Community Member, 136 Posts

18 October 2011 at 11:17pm

Honestly, I have no idea, but it sounds like that hosting is totally unsuitable (old PHP, Zeus Hosting and not recognising your rewrite script). I would simply recommend moving the website hosting to a more suitable set-up. Sorry I can't be more help on this. If any of my clients have hosting on Register365.ie here in Ireland I recommend that they move to LetsHost.ie or MyHost.ie or Digiweb or Blacknight (pretty much all of the other hosts are suitable).