子目录中的管理区域
我有一个既有前端又有管理区域的系统。
目前我正在给管理区域一个子域。
我想做的就是将其作为子目录,例如 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您有权访问子域,则可以将管理界面放置在 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.
我不这么认为。首先,“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.