apache mod_rewrite rules

11 views
Skip to first unread message

lachie

unread,
Jul 2, 2008, 4:15:38 AM7/2/08
to Gitorious
Hi,
I've finally got gitorious running well at work (Thanks for the code!)

When I click around in the source tree or a repo a level or two down I
get to urls like
http://git.rsp.com.au/projects/ts2/repos/mainline/trees/master/config%2Fenvironments
(notice the escaped slash %2F)

I also noticed that the same thing happens on the main gitorious site.

On my instance, a 404 results, but at gitorious.com, the file is
shown.

I'm guessing that its something to do with the mod_rewrite rules I
have.

Does that sound right? Or am I barking up the wrong tree altogether?
Would you be able to post the rewrite rules for gitorious.com?

Cheers,
Lachie

Johan Sørensen

unread,
Jul 3, 2008, 3:27:58 AM7/3/08
to gito...@googlegroups.com
On Wed, Jul 2, 2008 at 10:15 AM, lachie <lac...@gmail.com> wrote:
>
> Hi,
> I've finally got gitorious running well at work (Thanks for the code!)
>
> When I click around in the source tree or a repo a level or two down I
> get to urls like
> http://git.rsp.com.au/projects/ts2/repos/mainline/trees/master/config%2Fenvironments
> (notice the escaped slash %2F)
>
> I also noticed that the same thing happens on the main gitorious site.

Hmm, it really shouldn't escape that one, I'll look into it later today


>
> On my instance, a 404 results, but at gitorious.com, the file is
> shown.
>
> I'm guessing that its something to do with the mod_rewrite rules I
> have.
>
> Does that sound right? Or am I barking up the wrong tree altogether?
> Would you be able to post the rewrite rules for gitorious.com?

Gitorious uses nginx as the proxy server, so the only rewrite rules
are "send everything that isn't a file on the filesystem to the proxy
backend".

How does your apache directives look like?

JS
>
> Cheers,
> Lachie
> >
>

Liang Wang

unread,
Aug 25, 2008, 5:00:43 AM8/25/08
to Gitorious
I got same problem. Since I have little knowledge about rails, I have
to write a greasemonkey script to unescape slash.

I read apache doc about mod_rewrite. It says that url will be
unescaped before matching rewrite rule. I don't known nginx. It
might have similar behavior.

On Jul 3, 3:27 pm, "Johan Sørensen" <jo...@johansorensen.com> wrote:
> On Wed, Jul 2, 2008 at 10:15 AM, lachie <lach...@gmail.com> wrote:
>
> > Hi,
> > I've finally got gitorious running well at work (Thanks for the code!)
>
> > When I click around in the source tree or a repo a level or two down I
> > get to urls like
> >http://git.rsp.com.au/projects/ts2/repos/mainline/trees/master/config...
> > (notice the escaped slash %2F)
>
> > I also noticed that the same thing happens on the main gitorious site.
>
> Hmm, it really shouldn't escape that one, I'll look into it later today
>
>
>
> > On my instance, a404results, but at gitorious.com, the file is
Reply all
Reply to author
Forward
0 new messages