Challenge 1: Redirecting /old-blog/anything to /blog/anything — Solution Walkthrough The rule: RewriteEngine On RewriteCond %{REQUEST_URI} ^/old-blog/(.*)$ RewriteRule ^ https://example.com/blog/%1 [L,R=301] (An equally correct alternative captures directly in the RewriteRule pattern itself instead of using a RewriteCond backreference: RewriteRule ^old-blog/(.*)$ https://example.com/blog/$1 [L,R=301] Either form is a valid solution to this exercise.) Walking through it: - RewriteEngine On turns on the rewrite engine for this context, the same as every mod_rewrite example in this chapter. - The pattern ^old-blog/(.*)$ (or the RewriteCond form using %{REQUEST_URI}) captures everything after /old-blog/ into a backreference -- $1 when captured in the RewriteRule pattern itself, %1 when captured in a preceding RewriteCond. - That captured group is placed directly into the new URL (https://example.com/blog/$1 or .../%1), which is what "preserving whatever came after /old-blog/" actually requires. - [R=301] is what makes this an external, permanent redirect the client's browser actually sees and follows -- without it, this would silently rewrite the URI internally instead, which the exercise specifically asked NOT to do. - [L] stops any further rewrite rules from also trying to process this already-redirected request. WHY THIS WORKS AS AN ANSWER ------------------------------ This exercise checks that the reader can combine a capture group with a backreference to preserve part of the original URL, and correctly distinguishes an external redirect (needs [R]) from a silent internal rewrite (no [R] at all) -- the exact distinction this chapter's own mod_rewrite section draws.