BitByte-TPC / TPC-website

This is the official website of The Programming Club
https://iiitdmj.ac.in/webix.iiitdmj.ac.in
MIT License
7 stars 24 forks source link

404 on refresh #27

Closed arminpatel closed 2 years ago

arminpatel commented 2 years ago

Describe the bug

404 Not Found error at /team and /projects on refresh

To Reproduce

Steps to reproduce the behavior:

  1. Go to /team or /projects through homepage
  2. Refresh the page
  3. Or go directly to the pages through direct links projects, team

Expected behavior

Rendering pages like when opened through the homepage

Logs

If applicable, add logs to help explain your problem (e.g. the error message and/or exception traceback).

Environment (please complete the following information):

Additional context

My guess for the reason for the bug is that there are no actual routes to these urls and the showing of pages and url updating happens through javascript

Samy-33 commented 2 years ago

@Aksh-Bansal-dev, can you please take a look at this?

Aksh-Bansal-dev commented 2 years ago

I found that the react-router creates routes using javascript that works only on the client-side, so when we reload the page or request the page directly, the request goes to the server, not the client-side javascript. The server does not have the routes, so it returns a 404 error.

I don't have access to the web server's config, so I think the best option would be to use HashRouter.

Reference: link

Samy-33 commented 2 years ago

When you hit a URL suppose https://iiitdmj/team it will download some js files. I believe the issue is with the host web server's configuration. It must have been configured to return the js on the root url i.e. https://iiitdmj.ac.in/webix.iiitdmj.ac.in/ and it fails because there is nothing set to be returned on the https://iiitdmj.ac.in/webix.iiitdmj.ac.in/page url on the server.

It looks like we are using apache server to serve static content on path /webix.iiitdmj.ac.in.

image

Can you check what it is configured with? and probably introduce a wildcard /webix.iiitdmj.ac.in/* to return the same static files for club website.

Ping me on discord (sak3t#9425), let's discuss about it. If you have permissions to edit server config that would be great.

garg3133 commented 2 years ago

@Samy-33 Actually the server used to host this website currently is the same server on which our institute's website is hosted, and it is only configured to serve static content or run PHP websites. And no, we cannot get access to edit the configurations on this server.

There are a few other servers in the institute that we have access to, but since we are short of public IPs, not all servers are public. The servers which are public are either already hosting more than 1 website (alumni server) or is experimental (fusion). So, if we want to move out of here (which we do because we want to build a complete application with backend), we can either host it on either of the public servers or on a private server and set up a reverse proxy on one of the public servers. Or just wait till we have a new ISP who'll provide more public IPs to the institute.

Samy-33 commented 2 years ago

@garg3133, waiting for the new ISP doesn't sound like a good idea. Can you talk to the IT admin of our lab and ask him to change the server config?

As far as I remember, I was able to access the server on which our website is hosted, so it should be possible.

Cloud hosting sounds like a good idea, but is there a point to do that if there's not much activity to showcase on the website? We still need to work towards being more active in hosting events so that external interests is attracted.

Best bet is to talk to IT admin and ask them to make the change in Apache config to serve static files of club on path /programmingclub/** or something (using a wildcard so any path matching it still sends the static files).

garg3133 commented 2 years ago

Okay sir, I will talk to the IT Admin of CC on Monday and ask him if he could make the required changes in the Apache configs.

And about the events, I think the club is doing a good job in hosting the events, it's just that they are not showcased or talked about anywhere once they are completed. Because Google Developer Students Club is now also active in our college, which is managed by the same people as the club, most of the development-related events/sessions happen through GDSC and all the CP related events happen through the Programming Club. In the last academic session, I think the club has conducted 10-15 contests, 2 24-hr hackathons, 1 month-long Open Source Program and other sessions. And GDSC has conducted 20+ sessions on web, android, open-source, etc. @Aksh-Bansal-dev Please correct me if I'm wrong.

Aksh-Bansal-dev commented 2 years ago

Yeah, we have also conducted 2 six-month-long events, one for competitive programming and another for helping them with their projects.

Samy-33 commented 2 years ago

That's great.

Let's talk to co-ordinators of both the clubs and showcase the events, participants and the winners on the website. That would give some exposure to the performers and will also improve the sense of competition within the participants.

Just having static website doesn't do much good.

Tracking past events will also give us a view of how the environment was in the past and future gen can try matching and overtaking that.

When we were in college, our goal used to be improving programming environment within the college. Hearing about so many events being held, I think that goal is, more or less achieved. We just need to continue on the same path.

The next goal to achieve would be to bring attention of people outside campus to these events. That would form the base for future students to attract sponsors and recruiters.

My dream for programming club of IIITDM Jabalpur is to become an organisation in itself. Hopefully, we will be able to achieve that someday.

Discord is a better forum to discuss this. Locking this conversation here.