重命名根目录中的index.php
我的根目录上有两个应用程序,我试图将它们都保留在那里,但它们都有 index.php 文件作为目录索引。有没有一种方法可以重命名或更改其中一个,这样它们就不会重叠。或者让它们两者共存。
这些是我试图保留在同一目录下的应用程序。
应用程序 # 1 https://github.com/wolfcms/wolfcms
I have two applications on my root directory and im trying to keep them both there but they both have index.php files as a directory index. Is there a way to rename or change one of them so they dont overlap. Or have them both coexist together.
These are the apps im trying to keep under the same directory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不对这两个应用程序进行修改,您就无法做到这一点。为什么不呢?
这两个应用程序都使用 htaccess 重写将请求映射到
执行
DOCROOT/thisPath/.htaccess
,该请求重写请求以进行内部重定向到DOCROOT/thisPath/index.php 然后充当中央交换所来处理
SomeFutherContext
。为了使两者位于同一个
thispath
中,您需要集成它们的.htaccess
文件,有两个交换所条目,例如indexwolf.php 和indexshop.php,以及能够在 .htaccess 中通过一些正则表达式来解码SomeFutherContext
,以便您可以分派到正确的位置。但是,将它们设置为一个基于
http://yourdomain/wolfcms/
,另一个基于http://yourdomain/shop/
code> 很简单,只需按照两者的安装指南并在DOCROOT/thisPath/shop/
中安装 opencart 并在其.htaccess
文件中更改RewriteBase
到RewriteBase /shop/ 按照其指示。顺便说一句,
附录
如果您的托管提供商支持通配符子域映射器(默认情况下大多数都支持,因此请检查您的 HSP 常见问题解答或在这里发回您的托管提供商是谁),然后您可以使用子域(例如
wolfcms.yourdomain
)将其与您的商店分开,方法是将以下内容添加到您的文档根目录.htaccess
紧接在RewriteBase /
之后:然后将 WolfCMS 存储在
Docroot/wolf
中,其 .htaccess 位于DOCROOT/wolf 中/.htaccess
与RewriteBase /
(不是 RewriteBase /wolf)。You can't without modification to both applications. Why not?
Both application use htaccess rewrite to map a request to, say,
to execute
DOCROOT/thisPath/.htaccess
which rewrites the request to do an internal redirect toDOCROOT/thisPath/index.php
which then acts as a central clearing house to processSomeFutherContext
.For the two to sit in the same
thispath
, you would need to integrate their.htaccess
files, have two clearing house entries, say indexwolf.php and indexshop.php, and be able in the .htaccess through some regexp to decodeSomeFutherContext
so that you can dispatch to the right one.However, setting them up so that one is based on
http://yourdomain/wolfcms/
and the other onhttp://yourdomain/shop/
is trivial, just follow the install guide for both and install opencart inDOCROOT/thisPath/shop/
changingRewriteBase
in its.htaccess
file toRewriteBase /shop/
as it instructs.BTW,
Addendum
If your hosting provider supports a wildcard subdomain mapper (most do by default, so either check your HSPs FAQs or post back here who your hosting provider is), then you can use subdomain e.g.
wolfcms.yourdomain
to separate it from your shop, by adding the following to your docroot.htaccess
immediately after theRewriteBase /
:You then store WolfCMS in
Docroot/wolf
, and its .htaccess is inDOCROOT/wolf/.htaccess
with aRewriteBase /
(not RewriteBase /wolf).