Difference between "Redirect permanent" vs. mod_rewrite RewriteRule
Solution 1:
By default mod_rewrite does "302 Found" redirects, which are temporary. Assuming everything else is equal, Redirect permanent
is equivalent to RewriteRule <blah> [R=permanent]
.
Solution 2:
Is one better then the other?
Apache now recommends the use of Redirect
from mod_alias
instead of using RewriteRule
from mod_rewrite
. See https://httpd.apache.org/docs/current/rewrite/avoid.html#redirect , which says:
mod_rewrite should be considered a last resort, when other alternatives are found wanting. Using it when there are simpler alternatives leads to configurations which are confusing, fragile, and hard to maintain.