Category Archives:

htaccess Redirect Without Changing Address Bar URL

Thursday, April 15th, 2010
Posted in Uncategorized by Joel Gross

I had a problem: I wanted any URL that showed up after a certain directory to just pull from one file. So for example:

www.example.com/images/tree.jpg
www.example.com/images/2345.png
www.example.com/images/823947dfkasdf-dasdlkfjjk.html

All should point to:

www.example.com/image1.png

I found this excellent solution from jdMorgan at Webmasterworld:

RewriteEngine on
RewriteRule ^images /image1.png