This is my code in the .htaccess: Options -Multiviews Options +FollowSymlinks RewriteEngine on RewriteRule ^home$ home.php [L] Code (markup): With this code the url www.example.com/home does work but it doesn't redirect from www.example.com/home.php to www.example.com/home With this code instead: Options -Multiviews Options +FollowSymlinks RewriteEngine on RewriteRule ^home$ home.php [R=301,L] Code (markup): I get this error: Not Found The requested URL /var/chroot/home/content/08/236108/html/home.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. How can I redirect from home.php to home and avoid errors ? Code (markup):
if you want to redirect FROM home.php TO home you should change the order of RewriteRule parameters like this: RewriteRule ^home.php$ home [L]