Q:

htaccess redirect and remove filename

My redirect rules are preserving the filename and resulting in 404 errors.
The root rules I have are:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Then an example of a redirect is:
Redirect 301 /section-1/services.php http://www.domain.com/section-2/

But when tested it results in:
http://www.domain.com/section-2/services.php
I've looked everywhere for this specific issue and can't find the answer. It feels like it must be quite simple but just can't get anything to work.
Any help would be really great!

A:

Give this a try,
That redirect should work. However you can try this.
Remove this line or comment it out.
Redirect 301 /section-1/services.php http://www.domain.com/section-2/

And replace it with this. 
RewriteBase /
RewriteRule ^section-1/services.php$ /section-2/ [R=301,L]

