Can anyone tell me why the below 301 redirect is not working. I want to have it so any web pages with a .php at the end or http at the beginning get redirected to the version that would be the format of www.mysite.com. (not really the name of my website) All off the code I have in my htaccess file is below so could someone tell me what I am doing wrong?
# BEGIN WordPress
<IfModule mod_rewrite.c>
ReWriteBase /
Options +FollowSymlinks
Options -MultiViews
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.mywebsite.com/ [R=301,L]
RewriteCond %{HTTP_HOST} ^mywebsite.com
RewriteRule (.*) http://www.mywebsite.com/$1 [R=301,L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
ReWriteBase /
Options +FollowSymlinks
Options -MultiViews
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.mywebsite.com/ [R=301,L]
RewriteCond %{HTTP_HOST} ^mywebsite.com
RewriteRule (.*) http://www.mywebsite.com/$1 [R=301,L]
</IfModule>
# END WordPress