Search for files [in more than one directory]

Ask your mod_rewrite and Redirection questions here, and get answers!

Search for files [in more than one directory]

Postby produke » 30 Oct 2006 20:36

We program a explicit ruleset which searches for the files in the directories.

Code: Select all
RewriteEngine on

#   first try to find it in custom/...
#   ...and if found stop and be happy:
RewriteCond /your/docroot/dir1/%{REQUEST_FILENAME}  -f
RewriteRule  ^(.+)  /your/docroot/dir1/$1  [L]

#   second try to find it in pub/...
#   ...and if found stop and be happy:
RewriteCond /your/docroot/dir2/%{REQUEST_FILENAME}  -f
RewriteRule  ^(.+)  /your/docroot/dir2/$1  [L]

#   else go on for other Alias or ScriptAlias directives,
#   etc.
RewriteRule   ^(.+)  -  [PT]
User avatar
produke
 
Posts: 242
Joined: 25 Sep 2006 04:48

Return to Redirect or Rewrite Questions



Who is online

Users browsing this forum: ShakhtarrDon