Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package: remove the trailing slash sign from the URL address
Date: Thu, 19 Sep 2013 21:43:10 +0200	[thread overview]
Message-ID: <20130919214310.7098fa97@skate> (raw)
In-Reply-To: <CAAXf6LUXa6ep3KMMxVVvVKC0AxBM_Mboy2+SFtmBixQ-Zj6s-A@mail.gmail.com>

Dear Thomas De Schampheleire,

On Thu, 19 Sep 2013 09:06:48 +0200, Thomas De Schampheleire wrote:
> Hi Thomas,
> 
> On Wed, Sep 18, 2013 at 6:51 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
> > Dear Thomas De Schampheleire,
> >
> [..]
> >
> > I do certainly welcome some help with Apache configuration to make the
> > rewrite rules behave better. I hate doing sysadmin stuff, so when it
> > worked more or less, I considered it good enough :)
> >
> > What I currently have is:
> >
> >         RewriteEngine on
> >         RewriteCond %{REQUEST_FILENAME} !-f
> >         RewriteCond %{REQUEST_FILENAME} !-d
> >         RewriteRule ^/results/([a-f0-9]{3})([a-f0-9]{37})/(.*) /results/$1/$1$2/$3 [L]
> >
> > this is needed because the old URLs were:
> >
> >         /results/<complete-hash>/
> >
> > while the way it's stored (and the new URLs) are:
> >
> >         /results/<first three chars of hash>/<complete-hash>/
> 
> This is untested, but should work:
>         RewriteRule ^/results/([a-f0-9]{3})([a-f0-9]{37})/?(.*)
> /results/$1/$1$2/$3 [L]
> 
> This would also accept URLs of the form /results/<complete-hash>foo
> without any slash in between, but this would then fail after
> redirection I think. If you do not want that, I think you need two
> rules:
>         RewriteRule ^/results/([a-f0-9]{3})([a-f0-9]{37})/?
> /results/$1/$1$2/ [L]
>         RewriteRule ^/results/([a-f0-9]{3})([a-f0-9]{37})/(.*)
> /results/$1/$1$2/$3 [L]
> 
> The set of two rules is maybe cleaner, but I leave it up to you.

I've tried your second solution, but when I go to
http://autobuild.buildroot.org/results/510ea5d0889a6363e20f7fa14792e73d96923625/build-end.log
I get redirected to
http://autobuild.buildroot.org/results/510ea5d0889a6363e20f7fa14792e73d96923625/build-end.log/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/
with an error saying that the redirection didn't work.

I hate this RewriteRule stuff :)

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2013-09-19 19:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18 15:24 [Buildroot] [PATCH 1/1] package: remove the trailing slash sign from the URL address Jerzy Grzegorek
2013-09-18 15:34 ` Thomas De Schampheleire
2013-09-18 15:44   ` Jerzy Grzegorek
2013-09-18 17:56     ` Michael Rommel
2013-09-18 20:48       ` Jerzy Grzegorek
2013-09-18 22:31         ` Michael Rommel
2013-09-18 16:51   ` Thomas Petazzoni
2013-09-19  7:06     ` Thomas De Schampheleire
2013-09-19 19:43       ` Thomas Petazzoni [this message]
2013-09-18 22:48   ` Arnout Vandecappelle
2013-09-19 13:56     ` Michael Rommel
2013-09-20  6:23       ` Jerzy Grzegorek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130919214310.7098fa97@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox