Forum Moderators: phranque

Message Too Old, No Replies

wildcard and wild directorty redirect

file name redirect from any url

         

santapaws

10:28 pm on Jan 28, 2008 (gmt 0)

10+ Year Member



is it possible to have a file redirect to a single url no matter which directory its called for...

for some reason i get images called from every folder...so if say a file is
domain.com/gallery/image.gif

can htaccess be used to redirect all calls for image.gif from any folder to the correct one..

for say example
domain.com/wrongplace/image.gif
domain.com/wrongplace/verywrong/image.gif

have them all 310 to
domain.com/gallery/image.gif

Thanks

jdMorgan

11:11 pm on Jan 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using "friendly" URLs that cause these images to appear to be hosted in different directories when relative links are used to 'include' them on a page?

If so, it would be better to fix the existing code -- or to use server-relative or canonical links for the images, rather than to apply a band-aid that would make the images appear no matter what directory was requested ... Search "duplicate content penalty" for more information.

Server-relative link: <img src="/images/logo.gif">
Canonical link: <img src="http://www.example.com/images/logo.gif">

Be aware that the same problem can occur with external CSS and JavaScript files as well.

Jim