Apache Server configuration support - rewrite url if file does not exist to a given subdir

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > August 2006 > rewrite url if file does not exist to a given subdir





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author rewrite url if file does not exist to a given subdir
emmerink@gmail.com

2006-08-21, 1:26 am

Hi,

I like to obtain using .htaccess that requests in the format:

/usr/home/mine/public_html/files/(.*)/(.*)

where the first wildcard (.*) is a directory and the second (.*) is for
a filename.

will be rewritten if not found on the physical location to (where I
replaced the wildcards with there references):

/usr/home/mine/public_html/files/Image/$1/$2

but not if $1 is Image, because in that case it will if there is no
file, keep adding the Image subdir.

As an example:
request: http://www.mysite.com/files/nature/flower.gif
if found:
show the file on: http://www.mysite.com/files/nature/flower.gif
otherwise:
show the file on:
http://www.mysite.com/files/Image/nature/flower.gif

Thanks in advance for a solution,

Roderik

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com