apache - What is wrong with this RedirectMatch expression? -


i'm trying use redirectmatch:

redirectmatch 301 /(.*.p0) /(.*.p1)  

to replace page parameter in url. old url: http://www.example.com/some-list-c1-p0 new url: http://www.example.com/some-list-c1-p1

what wrong it?

or can make rule redirects 301 following kind of urls?

old url: http://www.example.com/some-list-c1-p0.html new url: http://www.example.com/some-list-c1-p1

i'm using:

redirectmatch 301 /(.*.p0)\.html /$1 

but can't 'p1' instead of 'p0'

your replacement side not contain references matches. the apache docs suggest examples this:

redirectmatch "(.*)\.gif$" "http://other.example.com$1.jpg" 

using $1, $2, etc. refer captured matches, try

redirectmatch 301 /(.*.)p0 /$1p1  

and see if works better.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -