子目录中的管理区域

发布于 2024-09-14 11:55:28 字数 240 浏览 2 评论 0原文

我有一个既有前端又有管理区域的系统。

目前我正在给管理区域一个子域。

我想做的就是将其作为子目录,例如 http://domain.com/admin

但管理区域设置为放置在根目录中。

我可以在 .htaccess 中添加一些内容以使子目录“/admin”认为它是根目录吗?

I have a system that has both a front end and an administration area.

currently i am giving the admin area a subdomain.

what i'd like to do it have it as a sub directory, e.g http://domain.com/admin

but the admin area is set up to be placed in root.

can i put something in my .htaccess to make the sub directory "/admin" think its the root?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浮云落日 2024-09-21 11:55:28

如果您有权访问子域,则可以将管理界面放置在 admin.domain.com 下,并使用 domain.com/admin 作为重定向。

这很可怕,但是软件对放置的要求也是如此。

If you have access to subdomains, you could place the admin interface under admin.domain.com, and use domain.com/admin as a redirect.

It's horrid, but so the software's requirement on placement.

黑凤梨 2024-09-21 11:55:28

我不这么认为。首先,“DocumentRoot”和“Alias”都不能出现在 .htaccess 中。
但无论如何,如果您考虑一下,当它读取您的 .htaccess 时,它已经解释了路径,因此更改它们为时已晚。

我不确定你是否能够通过重写来做你想做的事情。

I don't think so. First, neither 'DocumentRoot' nor 'Alias' can occur in .htaccess.
But anyway, if you think about it, by the time it reads your .htaccess it's interpreted the paths, so it's too late to change them.

I'm not sure if you might be able to do what you want with rewriting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文