简体   繁体   English

Apache别名/目录问题

[英]Apache Alias/Directory Question

I'm running XAMPP - apache 2.2. 我正在运行XAMPP-Apache 2.2。 I have 200+ folders in http://localhost/examplefolder 我在http:// localhost / examplefolder中有200多个文件夹

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. 我已经购买了另一个硬盘来平衡文件夹的负载,现在我在C:/ xampp / htdocs / examplefolder中有100多个文件夹,在D:/ examplefolder中又有100个文件夹。

How can I point both directories so that 200+ folders will appear in http://localhost/examplefolder ? 如何指向两个目录,以便200个以上的文件夹出现在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. 理想情况下,您应该尝试使用RAID 0,它将在两个硬盘之间透明地分布您的文件夹,但是,您的应用程序将访问它们,就像它们只是一个大硬盘一样。 In a bigger thing, you should consider distributed file system. 在更大的事情上,您应该考虑分布式文件系统。

Having that said, you could achieve what you want using mod_rewrite . 话虽如此,您可以使用mod_rewrite实现您想要的。 Basically, you will check the existence of the requested URI, if it exists, fine, let it through. 基本上,您将检查请求的URI是否存在,如果存在,请允许它通过。 If it doesn't, you will rewrite the C:/xmpp/htdocs/examplefolder part to become D:/examplefolder . 如果没有,您将重写C:/ xmpp / htdocs / examplefolder部分,成为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'? 如果我能澄清您想在一个“ Web文件夹”中显示来自不同驱动器的两个文件夹中的文件夹内容的问题,vHosts不会将您带到您要去的地方?

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+. 您可以通过仅添加第二个文件夹作为别名来解决此问题,并在一个文件夹中包含100+个文件夹,并链接到另一个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; 但是,我会问为什么要在一个“文件夹”中包含100个以上的文件夹,这会变得一团糟,除非存在用户结构或某种组织形式,否则我将很难找到东西,例如az文件夹等;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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