This is a discussion on rewrite url if file does not exist to a given subdir within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, I like to obtain using .htaccess that requests in the format: /usr/home/mine/public_html/files/(.*)/(.*) where the first ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |