Reputation: 612
I'm not sure how to properly write the directives in .htaccess to get URLs like this:
www.domain.com/photo/weather/p1741-high-stress.html
www.domain.com/photo/cultural-practices/p1752-thermal-convection.html
www.domain.com/photo/turf-diseases/p1748-algae-and-viruses.html
to:
www.domain.com/gallery/detail/high-stress
www.domain.com/gallery/detail/thermal-convection
www.domain.com/gallery/detail/algae-and-viruses
So essentially:
photo
to gallery
detail
p#####-
).html
at the endUpvotes: 0
Views: 44
Reputation: 11336
Regex to match original URLs:
www\.domain\.com/photo/[^/]+/p\d+-(.+?)\.html
Replace it with:
www.domain.com/gallery/detail/$1
Upvotes: 0
Reputation: 18671
You can use:
RewriteEngine on
RewriteRule ^photo/[^/]+/p\d+-(.+)\.html$ gallery/detail/$1 [NC,R=301,L]
Upvotes: 1