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.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

Installing 2.2.3: mod_rewrite troubles


Go to End


29 Posts   14590 Views

Avatar
Stoke

Community Member, 8 Posts

15 January 2009 at 10:53pm

Edited: 15/01/2009 10:54pm

I found this link .. which is kind of bizzare: http://forum.siteground.com/showthread.php?p=22645

- quote begin (Actually using [ quote ] makes it so small that it's unreadable ! )
Hi,

I just recently went through a painfulll silverstripe install and wanted to give some feedback. This error occurs on mo_rewrite test but is not caused by mod_rewrite, your siteground account should be set up for mod rewrite. The following link has simple code for testing mod_rewrite http://www.wallpaperama.com/forums/h...abled-t40.html

To fix the error on a standard install on siteground simply follow the instructions below. Hope this saves somebody some time.

***** silversripe httprespond installin Error on Siteground *******

- reason, silverstripe uses a HttpReference class that is already being called by php
- also causes mod_rewrite test to fail

Solution:
1) Open your copy new of the silverstripe install files.
2) Go to "sapphire/core/control/HTTPResponse.php" and rename it to "sapphire/core/control/SSHTTPResponse.php "
3) Open the new SSHTTPResponse.php and edit the HTTPResponse class to read SSHTTPResponse. Look through the file and change any other references to HTTPResponse to SSHTTPResponse.
4) Open the following files and change all references to the HTTPResponse to SSHTTPResponse.:
- sapphire/core/control/ContentNegotiator.php
- sapphire/core/control/Director.php
- sapphire/core/control/Controller.php
- sapphire/forms/Form.php

Save and upload all the files to their respective directories and run the silverstripe install.

************** Enjoy*************

- quote end

Avatar
RonG

Community Member, 11 Posts

16 January 2009 at 12:12am

Thanks for the suggestions. The installation is unfortunately still aborted with the exact same message.

Accessing http://silverstripe/InstallerTest/testrewrite in the browser (IE7) after the installation failed does give me a good result ("OK"), so is really not mod_rewrite causing the troubles here...

The strange thing is that I was able to install a previous version of SilverStripe on the exact same environment (Windows XP running an up to date installation of WampServer, www.wampserver.com) a couple of monhts ago.

Regards,

Ron

Avatar
Stoke

Community Member, 8 Posts

16 January 2009 at 12:55am

Absolutely bizzare.

Avatar
RonG

Community Member, 11 Posts

21 January 2009 at 3:24am

With help on IRC, I was able to solve this issue and install version 2.2.3 of SilverStripe.

The installation created the following line in .htaccess:

RewriteBase \

However, this should be:

RewriteBase /

Thanks.

Ron

Avatar
Stoke

Community Member, 8 Posts

21 January 2009 at 3:44am

Thanks for posting that here Ron.
Lol.
Simple error really ... ouch.

Avatar
Riel

Community Member, 3 Posts

27 January 2009 at 3:04am

Edited: 27/01/2009 3:06am

I get this message about 1 second before it pops away:

Installing SilverStripe...

I am now running through the installation steps (this should take about 30 seconds)

If you receive a fatal error, refresh this page to continue the installation

Creating 'mysite/_config.php'...
Creating /var/www/silver/mysite/_config.php
Creating '.htaccess' file...
Creating /var/www/silver/.htaccess
Building database schema...
Checking mod_rewrite works
http://**myip**/silver/InstallerTest/testrewrite Rewrite is DirectorySlash Off RewriteEngine On RewriteBase /silver RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$ RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* /var/www//sapphire/main.php?url=%1&%{QUERY_STRING} [L]
Creating /var/www/silver/.htaccess http://**myip**/silver/InstallerTest/testrewrite
ERROR: mod_rewrite not working, redirecting to mod_rewrite test page
Creating /var/www/silver/.htaccess I will now try and direct you to rewritetest to troubleshoot mod_rewrite

I looked in 'install.php' and it says this:

     if($base != '.') $baseClause = "RewriteBase $base\n";
        else $baseClause = "";


		
		$rewrite = <<<TEXT
<IfModule mod_dir.c>
DirectorySlash Off
</IfModule>

RewriteEngine On
$baseClause
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]
TEXT
		;

LIke after $rewrite = <<<TEXT

something goes wrong...

Directoryslash OFF and Rewriteengine ON should not be echo's, but are instructions, like the rest of the code?

Am I right?

Tried EVERY option in these threads, but can';t get it to install. Mod rewrite and those things are absolutedly sure allright ;)

Avatar
saemmi

Community Member, 6 Posts

12 February 2009 at 5:43am

I have exactly the same Problem as Riel. And it's really frustrating after trying everything in every thread. And it still doesn't work.

I am running
-Vista 64
-Xampp 1.7.0
(=> Php 5.2.8, Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8 )

Do you guys think there's the same problem when using linux? (Actually I will try when there's no progress with this problem...)

Avatar
Riel

Community Member, 3 Posts

12 February 2009 at 7:28am

Well, bad news: i'm trying in Linux (Ubuntu 8.04).

I have given up allready. Maybe the answer is not known, but I expected a bit more from a CMS who was stated as number one (the reason I came here ...)... No answer in few weeks... that's really too bad, everything looks great!