►
Description
This is a demo of how GitLab Pages supports defining splats, placeholders and rewrites in the _redirects file as part of the whole redirects feature https://docs.gitlab.com/ee/user/project/pages/redirects.html.
The feature will be enabled on https://gitlab.com very soon.
Please check the documentation MR (linked below) for instructions on how to enable this feature on self-managed installations.
Please add any feedback to https://gitlab.com/gitlab-org/gitlab-pages/-/issues/500
Documentation MR https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59803
A
Hi
everyone,
my
name,
is
jaime
martinez,
I'm
a
back-end
engineer
here
at
gitlab
and
today
I'm
going
to
show
you
the
support
for
splats.
Please
hold
their
redirects
on
pages
for
gitlab
pages.
This
is
a
very
requested
feature
from
a
lot
of
our
users
and
yeah.
This
is,
I
will
show
you
how
it
works,
and
how
is
this
enabled
right
now?
It's
only
on
our
staging
environment,
but
it
should
make
it
to
production
bracing.
A
So
I
have
a
project
here
this
redirects
file
and
I
can
show
you
actually
it's
the
same
one.
On
the
left
side,
we
have
a
set
of
basic
rules
that
have
been
working
for
a
while
already,
which
is
mostly
redirects
and,
as
you
can
see,
we're
adding
support
for
rewrites.
A
So,
instead
of
just
redirecting
to
a
302
or
301,
we
can
now
rewrite.
We
can
also.
We
also
support
this.
These
placeholders
here
to
be
replaced
and
I'll
actually
rewrite
as
well
splat
to
match
anything
that
goes
into
this
directory
to
redirect
to
this
file
and
some
placeholders
with
splats
and
a
bit
of
a
few
more
examples
with
the
splats
sorry
with
placeholders,
and
so
I
will
show
you
real
quick.
A
This
is
some
production
on
gitlab.com.
As
you
can
see,
this
file
is
telling
us
their
placeholders
are
not
supported
and
spots
are
not
supported.
A
A
Anyway,
we're
being
redirected
here
row
two
now:
let's
try
our
rewrite.
A
A
Yes,
cool
and
you
can
see-
I
actually
did
a
rewrite,
so
we
were
saved
at
200
down
here,
but
it's
showing
the
contents
of
this
post.
A
So
in
theory,
if
we
go
to
splat
any
path
in
here,
we
should
be
serve
the
contents
of
this
file.
So.
A
A
If
I
go
to
index.html
or
any
file,
we
serve
the
same
content.
I
forgot
to
test
this,
but
if
the
file
exists
already,
we
would
save
that
file
instead
of
redirecting
that.
So
that's
shouldn't
be
an
issue
and
then
let's
just
try
this
one
here,
what
happens.
A
A
A
Nope,
so
we
can
test
this
thing,
so
this
last
rule
is
matching
everything
to
that
to
index
serving
the
content
of
index,
so
whatever
dot
html
serves
me
the
content
of
index
without
redirecting.
However,
if
I
go
to
my
html,
this
is
not
me,
so
we
are
actually
sharing
the
content
on
the
file
because
it
exists.
A
This
is
really
nice
because
for
javascript
or
any
other
resources
that
you're
saving
should
they
should
be
served
as
well
with
them,
so
yeah
yeah
there.
It
goes
like
I
said
this
is
this
testing
is
on
staging
on
a
staging
environment,
so
once
we
have
validated
this
will
enable
it
in
production
and
for
cell
managed
instances.
A
A
I'll
put
that
in
the
box,
all
right,
if
you
have
any
questions,
feel
free
to
reach
out
to
this
issue
and
we'll
try
to
get
back
to
you
as
soon
as
possible.
Thanks.