The Goal
I need to merge access to XML files accessible from the root XML directory while still being able to access the domain user's XML files using the same client path.
The Setup
public_html/ (Not accessible on any domain)
public_html/.htaccess
public_html/www.example1.com/
public_html/www.example1.com/xml/ (domain XML/user XML)
public_html/www.example2.com/
public_html/www.example2.com/xml/ (domain XML/user XML)
public_html/www.example3.com/
public_html/www.example3.com/xml/ (domain XML/user XML)
public_html/xml/ (root XML/system XML)
So if a person requests...
http://www.example1.com/xml/example.xml
...Apache first looks for...
public_html/www.example1.com/xml/example.xml
...and if it can not find a file with the domain's user XML directory it then looks for...
public_html/xml/example.xml
...with the rule applying to any XML files in the XML directory.
I can rewrite files from the user XML directory to the system XML directory using this rule...
RewriteRule ^[^/]*/xml(.+) xml$1
...however that does not merge files from both the user and system XML directories. If we saw an Apache directory listing I need to see all the XML files listed from both the user and system XML directories. I'll reiterate that if there are files that share the same names that the user XML file should override the system file.
Keep in mind that I need to use the .htaccess file I've specified above to make sure this works for all domains. I've been trying to figure this out for two weeks without success, not sure what Apache uses in place of the word merge. Also my highest priority is getting something to work and then refining the code. Thoughts please?
- John