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
RonG

Community Member, 11 Posts

9 January 2009 at 6:40am

Hi,

I'm trying to install version 2.2.3 (latest stable) of Silverstripe on WampServer/Windows XP.

In the first (overview) screen of the installation, under "Webserver Configuration" it says "mod_rewrite enabled: OK" and I'm able to start the installation (using the empty template).

However, then the installation fails with the following error message (see also attached screenshot):

mod_rewrite doesn't appear to be working. Make sure:
mod_rewrite is enabled in your httpd.conf
AllowOverride is enabled for the current path.

Avatar
RonG

Community Member, 11 Posts

12 January 2009 at 9:20am

Nobody..?

Avatar
Stoke

Community Member, 8 Posts

14 January 2009 at 9:54pm

Edited: 14/01/2009 9:55pm

Please delete - dual post

Avatar
Stoke

Community Member, 8 Posts

14 January 2009 at 9:54pm

Edited: 14/01/2009 9:56pm

I am trying silverlight out on an Ubuntu installation.

(Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.4 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g Server at ss.co.za Port 80)
(PHP version 5.2.4-2ubuntu5.4)
(MySQL 5.0.51a-3ubuntu5.4)

I got the same problem and have analysed the created .htaccess file:

### SILVERSTRIPE START ###
RewriteEngine On
RewriteBase /
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]
### SILVERSTRIPE END ###

There was an odd character in the RewriteRule line.

To get mine working, I edited rewritetest.php, and re-typed the RewriteRule line, and then deleted the old rewriterule line.
I suspect some odd characters somehow slipped into the file.

Here is the excerpt from the file rewritetest.php that you should check:

$rewrite = <<<TEXT
RewriteEngine On
RewriteBase $base

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] <<<<<<<< Retype this line and then save the file.
TEXT

Good luck.

Avatar
RonG

Community Member, 11 Posts

15 January 2009 at 1:39am

Hi Stoke,

Thanks for your reply.

Unfortunately, modifying the file rewritetest.php (before starting the installation) as suggested by you did not work for me. I still get the message "mod_rewrite doesn't appear to be working".

However, I'm running an installation of WordPress (latest, version 2.7) on this machine which is also using mod_rewrite, without any problems. And as said in the first screen of the installation of SilverStripe it says "mod_rewrite enabled: OK"

Ron

Avatar
Stoke

Community Member, 8 Posts

15 January 2009 at 2:05am

Edited: 15/01/2009 2:07am

OK, the other things I changed are as follows:

I ran : a2enmod rewrite.load

to enable the rewrite.load mod in apache, this you must have done previously. This just adds a link to /etc/apache2/mods-available\rewrite.load in /etc/apache2/mods-enabled.

Then, I edited my apache2 site configuration file ss.co.za so that the directory configuration section looks like this:
<Directory /media/samba/PublicFolder/HTTPStoke/ss>
Options FollowSymLinks SymLinksIfOwnerMatch
AllowOverride All
Order allow,deny
allow from all
</Directory>

Apparently the "FollowSymLinks" and "AllowOverride All" parts are vital.

I then restarted apache2 : /etc/init.d/apache2 restart
Then I clicked on "check agian" on that page, and it indicated that the configuration was ok.

P.S. Also, don't forget to make a blank .htaccess and make it writable to the process running your website in your website's root directory.

Avatar
RonG

Community Member, 11 Posts

15 January 2009 at 6:01am

Still no luck... :(

When I disable mod_rewrite in Apache and then try to install SilverStripe, under "Website Configuration", it says "mod_rewrite enabled: Not OK" (or something similar). So SilverStripe does recognize mod_rewrite.

After enabling mod_rewrite, restarting my Apache service and launching SilverStripe, it says "mod_rewrite enabled: OK".

But then after pressing "Install SilverStripe" I get the issues described in this topic.

Avatar
Stoke

Community Member, 8 Posts

15 January 2009 at 10:10pm

Okay, I don't really understand this, I have now done another install and I get the same problem that you get again.

So, I once again manually edited .htaccess so that it looked like this:
### SILVERSTRIPE START ###
RewriteEngine On
RewriteBase /
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]
### SILVERSTRIPE END ###

Then I went to firefox and entered :
http://ssm.co.za/InstallerTest/testrewrite
And that worked fine.

So, I decided that the actual rewrite mod was working fine, something else is borked, so I just "force" continued.

BUT, then I came across the other problem, where, after the files are deleted, it keeps on trying to access check-php.php when accessing http://ssm.co.za.

I am using FireFox however, and after going and manually deleting all the cache'd files, accessing http://ssm.co.za worked properly.

Now I'm wondering if the other problem is not also firefox related.

i.e. If you're still doing this and using Firefox, try deleting your firefox cache files manually. (Deleting them from within firefox does not work properly). There are kept in F:\Documents and Settings\Stoke\Application Data\Mozilla\Firefox\Profiles\yx4szwtv.default on my computer.

Good luck!

Go to Top