Forum Moderators: phranque
1) You must escape(\.) any periods since they are used in regular expression matching.
2) You need to start the rewritten URL with a slash.
RewriteRule ^(.*)_bar\.html$ /foo.php?input=$1
Birdman
PS: You can also add the end anchor($), since you know there will be nothing after the .html.
Birdman
Options +FollowSymLinks in your htaccess file, if is it not there already. You need to enable symbolic links in order to have the mod_rewrite working properly.
RewriteRule ^silly_file\.html [i]real_file[/i].html The second (missing) slash in your RewriteRule is not a problem since in the htaccess files only the "local" path appears, any directory reference from the url which is above the current one is stripped off, and unless you use fully qualified url (starting with [)...] for the substitution string, the stripped part will be added back after the last rule. So you don't need to worry about that. But this means that if the /abc (virtual) directory is an alias for the /xyz directory, then the mod_rewrite should know that the url which needs to be added in front of the rewritten url is not /xyz but /abc, then you have to use the RewriteBase directive to "fix" this. See the mod_rewrite documentation [httpd.apache.org] for further details.