I want to redirect from http://www.mydomain.com/dir/index.php to http://www.mydomain.com/dir/sef_category/sef_title, is the following code correct? This code will be put in .htaccess in the dir directory. RewriteBase /dir/ RewriteRule ^index.php$ http://www.mydomain.com/dir/sef_category/sef_title/ [R=301] Code (markup): Having thought about it, I am not sure if this will work because the sef evaluation is done in index.php.