简体   繁体   中英

Apache Alias/Directory Question

I'm running XAMPP - apache 2.2. I have 200+ folders in http://localhost/examplefolder

I have bought another hdd to load balance the folders, now I have 100+ folders in C:/xampp/htdocs/examplefolder and another 100 folders in D:/examplefolder.

How can I point both directories so that 200+ folders will appear in http://localhost/examplefolder ?

I don't want it to have different folder name.

The answer depends on your final environment/application. Ideally, you should try RAID 0 which will transparently distributes your folders amongst the two harddisks, however, your applications will be accessing them as if they were just one big hard drive. In a bigger thing, you should consider distributed file system.

Having that said, you could achieve what you want using mod_rewrite . Basically, you will check the existence of the requested URI, if it exists, fine, let it through. If it doesn't, you will rewrite the C:/xmpp/htdocs/examplefolder part to become D:/examplefolder .

vHosts won't get you where you want to go, if I can clarify the question you want to show folder contents from both folders from different drives in one 'web folder'?

You could get around this by just adding the 2nd folder as an alias , and having 100+ in one folder and a link to the other 100+.

However, I would question WHY you want 100+ folders in one 'folder', this is getting messy, and I would assume hard to find thing, unless this is a user structure or some form of organization: folders az, etc;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM