所有的URL都指向根目录,而我们需要一个项目文件夹 [英] All URL are pointing to root instead we need a project folder

查看:181
本文介绍了所有的URL都指向根目录,而我们需要一个项目文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的node和gulp
我创建了一个项目并且工作正常,但是当我在某个web服务器(tomcat)上托管我的项目时,我遇到了一个问题。所有网址都指向根目录,而不是我们需要的项目文件夹



请指导我缺少的内容

<$ p $当前:http:// localhost:8000 /
我需要这样的东西:http:// localhost:8000 / projectName /


解决方案

我在应用程序中完成了这项工作,其中有一个应用程序基本上构建了另一个应用程序。他们紧密结合在我的情况下,所以我在git中为这两个项目创建了一个单一的存储库。

对于您的情况,如果它只有一个应用程序&只有路由问题,我会配置apache或HAProxy重定向 http:// localhost:8000 / http:// localhost:8000 / projectName 。我只在nginx& HAProxy,但它应该很容易与其他设置。 本教程可能会有所帮助。


I am new to node and gulp I create a project and its working fine but I am facing an issue when i am hosting my project on some web server (tomcat). All URL are pointing to root instead we need a project folder

Please guide me what i am missing

currently : http://localhost:8000/
I need something like this : http://localhost:8000/projectName/

解决方案

I've done this on applications where I have one application that essentially builds another application. They are tightly coupled in my case so I created a single repository in git for both projects.

For your case, if its only a single app & only a routing issue, I would configure apache or HAProxy to redirect http://localhost:8000/ to http://localhost:8000/projectName. I have only done this in nginx & HAProxy but it should be easy enough with other setups. This tutorial might help.

这篇关于所有的URL都指向根目录,而我们需要一个项目文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆