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.

Archive /

Our old forums are still available as a read-only archive.

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

Mod_rewrite fix for some Apache servers. (Try this if rewrite doesn't work even if your server has mod_rewrite)


Go to End


8 Posts   7058 Views

Avatar
Jagged

Community Member, 2 Posts

28 July 2007 at 9:32pm

Replace the Defaults:

RewriteRule \.js$ - [L]
RewriteRule \.css$ - [L]
RewriteRule \.png$ - [L]
RewriteRule \.jpg$ - [L]
RewriteRule \.gif$ - [L]
RewriteRule \.php$ - [L]

with:

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

They are functionally equivalent (to my knowledge), the later works on a wider range of Apache versions.

Avatar
Tim

Community Member, 201 Posts

31 July 2007 at 3:25pm

Cheers for the Patch Jeremy :-)

Avatar
Hansa

10 Posts

5 August 2007 at 1:27pm

I've managed to get SS working on one of my servers but on another one it gives me the usual:

mod_rewrite is enabled in your httpd.conf
AllowOverride is enabled for the current path.

How do i apply this patch?

Avatar
Sean

Forum Moderator, 922 Posts

5 August 2007 at 2:45pm

You should be able to do the above change in the .htaccess file where SS is installed.

Cheers,
Sean

Avatar
Hansa

10 Posts

6 August 2007 at 5:15am

I think the problem is the AllowOverride, how do i turn this on?

Avatar
Hansa

10 Posts

6 August 2007 at 8:56am

Edited: 06/08/2007 9:01am

I have finished my first site, www.macgregorforestandgarden.co.uk :)

What kind of comment do i add to .htaccess for AllowOverride?

Does it have to be specific?

Avatar
Hansa

10 Posts

7 August 2007 at 3:24am

Yeah, i don't have access to httpd.conf file. I'll contact the server administrator.

Avatar
Maxximus

Community Member, 7 Posts

13 September 2007 at 9:37am

In some cases (mine;) you need to add the line:

RewriteBase /

on line 1 of your .htaccess