pyramid on webfaction: problems serving static files - pyramid

so i have a site on webfaction that runs pyramid. it's all working ok except some static files are not serving. 4 to be specific and i dont know why.
http://karantan.webfactional.com/static/images/bg2.jpg
this link gives me 404 but the image is there! also same goes for fonts. 3 font links:
http://karantan.webfactional.com/static/css/fonts/titilliumtext25l005-webfont.woff
http://karantan.webfactional.com/static/css/fonts/titilliumtext25l005-webfont.ttf
http://karantan.webfactional.com/static/css/fonts/titilliumtext25l005-webfont.svg
again. all files are there!
as far as i know all other files are serving ok. so does any1 have any idea why this would happened? and how to fix the problem

As you mentioned in your comment, WebFaction pointed me to using a nginx static server for this problem, too. I was running into the same thing with an included TinyMCE library; javascript would serve up fine but some static HTML pages would throw a 404 error. I'm still not sure why it works that way....

Related

Issues regarding reloading a react-based webpage

I'm a student working on a project to benefit other students, and I am currently facing a problem with reloading with any other url than the main path.
The webpage is written from scratch (more or less) in React with no backend, but I still hoped that it would work. I am using react-router to change sub-directories.
I have understood that there is a difference between server- and client-url's, and that this issue most likely is related to that. In the app's main directory "webpage.com" everything works fine untill the page is refreshed. If a sub-directory such as "webpage.com/link" is "called" directly, I recieve an error. You can go and try for yourself btw.
Does anyone know of a nice way to fix this? Do I need to implement something like Node.js to fix this? If so, how? I would prefer not to use a hot-fix such as redirecting all sub-directory calls (such as "/link" (an actual page) or "/kejrngo" (jibberish) ) to "/".
I've cloned your project locally and it seems you have a problem with the server. As you said yourself it seems that only open url for your page is http://ifistudenter.no where at the beginning all application is rendered. After you try to refresh the page you are looking for a path that isn't available on the server and that is the reason you get 404.
What seems to be a problem is React Router itself with Apache server:
Please look at this: https://www.malikbrowne.com/blog/using-react-router-with-apache hope it helps

Socket.io.js can't be found (404)

I've developed a small chat application with Socket.io and Express, currently deployed on my droplet at digital ocean. You can see it live at https://keleheart.com/chatapp. It currently doesn't work because the server is giving back a 404 for the chatapp/socket.io/socket.io.js script I have at the bottom of my html file, should be able to see that when you visit the site and hit f12
I've been through a few fixes already that were popular on here such as This one and this one and I've even tried changing the script from local to a CDN as depicted here , and the CDN seems to work better,(still gives the 404 but it then no longer says io isn't defined??) but it still doesn't produce the output I need.
You are able to review my repo on my Github Page for this as well, there's just the index.html file for the client and then the chatApp.js for the server. The error is coming from my html file but all the fixes have told me to manipulate my package.json, server variables, and nothing has worked so far. My server still cannot find chatapp/socket.io/socket.io.js
Have you tried creating the /socket.io folder next to index.html, and putting a copy of socket.io.js inside of that? That has always worked for me, but you might have to hunt through the node_modules folder to get the file. This always fixed it for me.
And of course, be sure to actually serve the file using express's static method.
Your browser is giving you the correct error message. Since /socket.io/socket.io.js does not exist on the server, the browser displays the server's 404 message.

Hosting a static site with Yesod

I'm experimenting with Yesod and I've created a simple scaffolding site with yesod. I've downloaded a bootstrap template site and wish to simply host this site with yesod. The template site has an index.html and a bunch of css and js files. This seemly simple task has baffled me. By my understanding, the site should be placed under the 'static' directory, I tried to use sendFile to send the index.html file in getHomeR, but only the content of the that file is displayed, without the css and js. Should I do this with a Subsite?
Thank you
Have a look in your browser console, most likely you're getting 404s due to bad relative links. I'd try using a redirect call to point to the static for so that all of the relative links are correct.

Umbraco throwing 404

I have an umbraco 4 site that I have put a google sitemap onto. This all works fine locally but on the live server I am getting an IIS 404 error (not the umbraco 404 error) - see this link.
However if I preview the node it works fine
I have googled why I would get a 404 and so far I have come up with the following causes which I have checked and can rule out as the cause:
the template is not assigned
there are multiple nodes with the same url
Would anyone know what is causing this problem or how I could fix it?
Update
I have deleted the preview node now as I recreated the node in a different place and it worked. Would still like any thoughts on why I would get a 404 though, just in case a similar thing happens in future
Unfortunately both your links are going to the IIS error page as well as all the other errors on the site so we cant tell what you sitemap should be, see this link for tips on how to set up the 404 page http://www.simonantony.net/knowledge-base/articles/how-to-setup-a-404-error-page-on-your-umbraco-site/ .
Make sure that's working across the whole site then with you Google site map is it an XML sitemap or HTML sitemap and how have you implemented it did you use a package or made it you self.

CodeIgniter not working on PHP 4 server without .htaccess availability

Basically i developed my app on a localhost wamp server with PHP 5. ON uploading to the actual host i notice that
The server is running php 4.4.9
Everytime i upload my .htaccess file, the server removes it completely.. seems to not be allowed
When i test out the set all i get is a 404 page not found
Any help on how to make it work on this PHP 4 server?
I did a test with CI 1.7.2, default installation.. works on my local server but when uploaded does not work, does this mean that the server does not support it?
I'm sure this isn't what you want to here, but get a new server. Here are the reasons why:
PHP 4 is no longer well supported. It's insecure.
If the server is removing .htaccess files, they are also unsupported on that server, giving you one more reason to move.
Code Igniter runs best with PHP 5 and with an .htaccess file.
The gist of this is you are going to have to hack your code back into the dark ages to get this to work, and then you will still have pretty URL issues and overall system instability. If you can make the switch, do.
If you cannot use .htaccess files with CodeIgniter, in system/application/config/config.php there is a configuration key called index_page. You need to set that to whatever page you have bootstrapping CodeIgniter (usually /index.php)
Then, make sure all your links that get routed through CI either target index.php/controller/action/params... or utilize the URL helper (with site_url or anchor) to automatically put in the index.php
Joe Mills is exactly right in his answer, though. CI works best with PHP 5 and .htaccess.
See CI URLs and CI URL Helper for documentation.
Well i found out how to fix several things
The issue with .htaccess would be to just not use modrewrite as such i put "query_string" option in my path variavable and this works.
The other issue, which was the major issue was that i was using Datamapper library which is a php 5 only library.

Resources