RewriteEngine On RewriteCond %{QUERY_STRING} (.*) RewriteRule ^s\/(.+)\.php$ http://site.com/foo/index.php?%1&page=$1 [R,L] Query: http://site.com/foo/Services.php? Result: Not Found The requested URL /foo/Services.php was not found on this server. Apache/2.0.58 (Unix) Server at site.com Port 80