I need a Rewrite Rule for apache to rewrite urls like:
to
So, I need to remove all / parts between the "archives" and the last /, preserving the part before the / and after the /.
I need a Rewrite Rule for apache to rewrite urls like:
to
So, I need to remove all / parts between the "archives" and the last /, preserving the part before the / and after the /.
Something like this should do what you want:
RewriteRule ^(/~dun3/archives/).+?/([^/]+/[^/]+)$ $1$2 [L,R=301]
(The final R=301 part sends a HTTP 301 Moved Permanently
header, which I presume is what you want to do, but if not you can simply omit that part.)