Google Drive CSS/Js Returns 404 Error

I have an css 404 error with my website but the css exsits

I can identify two issues.

First is that the code just concatenates __dirname + 'public/css'. The __dirname does not include a trailing slash, so if your path is /home/foo, you'll get a path like /home/foopublic/css. Use path.join() instead.

Second, the HTML appears to refer to the CSS file relative to the location of the HTML on your disk. As there is already a handler for the path /css set which serves files from the css directory on your disk, the correct path would be /css/signin.css instead of ../public/css/signin.css.

So, on the node.js side:

const path = require('path')

app.use('/css', express.static(path.join(__dirname, 'public/css')))
app.use('/js', express.static(path.join(__dirname, 'public/js')))
app.use('/img', express.static(path.join(__dirname, 'public/img')))

Although you don't really even need these, as there app.use(express.static('public')) middleware already serves the files and directories from the public directory.

And the HTML:

<link rel="stylesheet" href="/css/signin.css">

Bootstrap Unresponsive In Safari - Host: Google Drive

I found out there is no privilege access for non google login user. So make your CSS and JS files as public

You need to give the access to all these files, and also need to check with other browsers that are not logged in with google account.

<link href='https://googledrive.com/host/0B3X3aqxEWs4QZGtzMS16YVJrdkE' rel='stylesheet' type='text/css'/>
<link href='https://googledrive.com/host/0B3X3aqxEWs4Qa3JiSWt1Z1JNNlU' rel='stylesheet' type='text/css'/>
<script src='https://googledrive.com/host/0B3X3aqxEWs4QTFJ0ejUxZ0t0dFU' type='text/javascript'></script>
<script src='https://googledrive.com/host/0B3X3aqxEWs4QeVNqdjBYRkRMclU' type='text/javascript'></script>

Sample Image

Google Web Font wont display in Chrome, when hosted on Google Drive

Your app in google drive under HTTPS, but you try to load fonts from HTTP
just change http to https when you load fonts in font-face directive

[blocked] The page at 'https://googledrive.com/host/0B0LF26cYLcG7ZThfUGF5TFE1eUE/index.html' was loaded over HTTPS, but ran insecure content from 'http://fonts.googleapis.com/css?family=Exo+2:400,400italic,700': this content should also be loaded over HTTPS.

And you need to learn how to use devtools in chrome. it will help you in the future.

Problems With Hosting Websites With Google Drive

Okay, so I looked at the properties of my file on Google Drive. It said that the file type was plain text. I downloaded the file and then uploaded it again as an html file. I got the document ID and tried again. This worked. The problem was that Google saw a plain text document so that's what it rendered. I just needed to change the file type of the file. I solved my problem although I cannot logically make sense of why my file downloaded as an html file if on Google Drive it was a plain text format.

Google drive web hosting

The issue is resolved, instead .htm I converted them and used .html extension.

How can I solve net::ERR_ABORTED 404 (Not Found) in a view, error dont let display the css Laravel 6.0?

http://127.0.0.1:8000/entradas/1/comprar/1/detalle_ventaEntrada/200000/css/bootstrap.min.css

Here you can see your .css file is trying to load from this url, which is not correct.

Use laravel built in asset() function.

https://laravel.com/docs/master/helpers#method-asset

Which will point to public folder of your application so:

use asset('expamleFolder/bootstrap.js'),
it will look for your bootstrap.js inside public/expamleFolder.

Note: always keep assets in public folder.


Replace this with old code

<link rel="stylesheet" href="{{ asset('css/bootstrap.min.css') }}">
<link rel="stylesheet" href="{{ asset('js/jquery.stellar.min.js') }}">

this is solution for that 2 error



Related Topics



Leave a reply



Submit