logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: 2.2.13 and mod_rewrite
Author
Smitty



Joined: 03 Jan 2008
Posts: 197

PostPosted: Wed 12 Aug '09 22:51    Post subject: 2.2.13 and mod_rewrite Reply with quote

I just tried to update my dev box to 2.2.13. Small problem...I have this in my httpd.conf file:

RewriteEngine on
RewriteRule ^/$ /moodle/ [R]
RedirectMatch ^/$ /moodle/ [R]

This worked in Apache 2.2.10 and versions prior to that...when someone typed in our URL, www.example.com it automatically redirected them to www.example.com/moodle/ and loads our Moodle installation.

Now, with 2.2.13, the server refuses to start. It starts, of course, if I comment out the 3 lines above. Anybody have any ideas why this doesn't work now?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 12 Aug '09 23:01    Post subject: Reply with quote

RewriteRule ^/$ /moodle/ [R]

shouldn't there be a "not" (!) in there somewhere?

If NOT moodle -> moodle

RewriteRule !^/$ /moodle/ [R]
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Thu 13 Aug '09 2:53    Post subject: Reply with quote

Your third line:
Code:
RedirectMatch ^/$ /moodle/ [R]
has an error.

RedirectMatch is not a mod_rewrite directive. It is a mod_alias directive. You can't use [flags] like [R] with RedirectMatch.

That's always been an error - but starting with Apache 2.2.13, mod_alias checks its arguments more carefully.

-tom-
Back to top
Smitty



Joined: 03 Jan 2008
Posts: 197

PostPosted: Thu 13 Aug '09 14:34    Post subject: Reply with quote

Tom,

Thanks! That worked. Obviously I got away with the mistake for several Apache versions!
Back to top


Reply to topic   Topic: 2.2.13 and mod_rewrite View previous topic :: View next topic
Post new topic   Forum Index -> Apache