rewrite url if file does not exist to a given subdir

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-21-2006
emmerink@gmail.com
 
Posts: n/a
Default rewrite url if file does not exist to a given subdir

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:20 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0