Presumably, the rules are functionally equivalent (well, assuming that http://dejanseo.com.au/blog/spam/
was supposed to be http://dejanseo.com.au/blog-spam/
like the first one redirects to, and the only host pointing at that location is dejanseo.com.au
with or without the www
).
The first example uses directives from mod_rewrite
, whereas the second one uses some from mod_alias
. I imagine that the preferred option is the second one for this particular case, if not only because it's a bit simpler (there's also marginal additional overhead involved in creating the regular expressions being used by mod_rewrite
, but that's very minor):
Redirect 301 seo_news_blog_spam.html http://dejanseo.com.au/blog-spam/
However, I suspect the reason that you have the first one is that it was created using CPanel (based on the unnecessary escapes in the replacement that appeared before in another user's question where it was indicated CPanel was the culprit). They've gone with the mod_rewrite
option because it provides conditional flexibility that the Redirect
directive does not, and I assume this flexibility is reflected somewhat in whatever interface is used to create these rules.
You'll note that there is a condition on whether or not to redirect based upon your host name in the first example, identified by the RewriteCond
. This allows for you to perform more powerful redirects that are based on more than just the request path. Note that mod_rewrite
also allows for internal redirects invisible to the user, which mod_alias
is not intended for, but that's not the capacity it's being used in here.
As a final aside, the host names in your RewriteCond
statements should technically have their dots escaped, since the .
character has special meaning in regular expressions. You could also combine them, change them to direct string comparisons, or remove them altogether (since I imagine they don't do anything useful here).