Because you need to put the Rewrite statement before the # BEGIN WordPress block. Otherwise the WordPress block will find that it can serve the URL and the Rewrite statement after that will be ignored; putting the Rewrite before the WordPress block solves that.
First, I’ve got to assume that you’re referring to the Redirect statement, not the “Rewrite statement.”
Second, mod_alias is part of the Apache core so it makes no difference where it’s located (other than to help humans reading the code) because core directives are processed before non-core (mod_rewrite) directives. That’s simply not the problem.
Brian,
Obviously, you’re not looked at any of the WP threads in this board.
The problem you’re having with the about.html => about-us/ redirection is that you’re syntax is faulty. The syntax for the Redirect statement is
Redirect [status] URL-path URL
… where the [status] is optional (but should be included), the URL-PATH will not contain either the protocol (http://) or the {HTTP_HOST} (www.utahlibertylaw.com). The URL for the redirection must be absolute (/about-us/) or the complete (external absolute) URL (which you’ve done - albeit I’m not a fan of redirecting a file to a directory).
As for WP’s code:
REMOVE the <IfModule> wrapper after testing. Not to do so is an abuse of the server (and should have you kicked off a shared server). It’s such an egregious error that I have a standard rant for it:
[rant #4][indent]The definition of an idiot is someone who repeatedly does the same thing expecting a different result. Asking Apache to confirm the existence of ANY module with an <IfModule> … </IfModule> wrapper is the same thing in the webmaster world. DON’T BE AN IDIOT! If you don’t know whether a module is enabled, run the test ONCE then REMOVE the wrapper as it is EXTREMELY wasteful of Apache’s resources (and should NEVER be allowed on a shared server).[/indent][/rant 4]
Nothing personal … but it’ll help you remember.
RewriteBase is designed to UNDO a mod_alias redirection. Where’s the redirection? Do you really want to undo your about.html => about-us/? Remove this before it causes problems.
I have no clue why WP added the RewriteRule ^index\.php$ - [L] statement as it’s already handled by the RewriteCond %{REQUEST_FILENAME} !-f so I remove this, too.
Finally, the . in the RewriteRule is demanding at least a single character in the URI. If there is none (only the domain is requested), then this should fail. I prefer to add a ? after the dot character to make it optional. In addition, since this code is already located in the DocumentRoot, there is no need for the / before index.php in the redirection.