Github pages not recognizing idex.html - github-pages

Going to https://jkarimi91.github.io throws a 404 error. However, going to https://jkarimi91.github.io/index loads the homepage i.e. index.html just fine. Why is https://jkarimi91.github.io not fetching index.html?
The site files can be found at https://github.com/jkarimi91/jkarimi91.github.io

Related

i deploy django project in cpanel(namecheap) without base url others urls are not working

i deploy django project in cpanel(namecheap) without base url others urls are not working
Not Found
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Subdirectory pages not found static site hosted on Google Cloud Storage Bucket

I'm setting up a static site on a Google Cloud Storage Bucket with Loadbalancer. The site gets generated with Gridsome and then the dist folder gets saved in the bucket.
I have set the index and error with gsutil like in the [documentation]: https://cloud.google.com/storage/docs/gsutil/commands/web
Now I am facing a problem with how every url for accessing subdirectories gets redirected to dir/index.html. This is desired behavior, the dir/index.html page even exists in the bucket. But I still get a 404 - not found.
If I do a curl to the url subdir/index.html I get the HTML
I do not know exactly how you are testing your subfolder but I think this link can help you with your issue Error 404 when loading subfolder on GCS. In addition, you maybe must to take a look here How subdirectories work.
Based on How subdirectories work on GCS, when browser request URL http://www.example.com/dir it will be redirect (301) to The object http://www.example.com/dir/index.html on content served.
My assumption is there is no route http://www.example.com/dir/index.html on Vue (vue-router). So it will be throw to Not Found 404 page.
The simple solution is try to change all subdirectories link from
http://www.example.com/dir, http://www.example.com/about etc, to
http://www.example.com/dir/, http://www.example.com/about/
It will not redirect to 404 page when you request subdirectories url or reload the browser. But we all know that it's not best practices.

How to Handle Incomplete Django/Nginx File Server URLs?

I have a Django website that uses Nginx on a separate file server to serve up images uploaded by my users. When any user views another user's photos, the link to the photo will have this structure:
https://fs01.mysite.com/media/photos/<username>_<photo-id>.jpg
When the page is rendered, the user's photo is served up by the file server (fs). But what is the Nginx way of handling incomplete (one could also say incorrect) requests to subdirectories of the above URL? For example, if a user enters this URL:
https://fs01.mysite.com
...they see Nginx's default "Welcome to nginx on ..." page. If they enter this URL:
https://fs01.mysite.com/media
...they'll get the Nginx "404 Not Found" page. And if they enter this URL:
https://fs01.mysite.com/media/photos
...they'll get the Nginx "403 Forbidden" page.
How do you handle these situations in Nginx?
They see welcome page, because the nginx matches default vhost entry instead of yours. You should probably delete the default one (/etc/nginx/conf.d/default or /etc/nginx/sites-enabled/default, depending on the linux distribution you use) and make sure that server_name line matches your url (i.e. no slash at the end).
Looks like your location block matckes only media/ (with the slash at the end). Thats why you get 404 error - it matches different location block and is probably handled by Django.
You are not allowed to list the directory, so you get the Forbidden error.
I think that it is up to you how such cases are handled, just make them consistent. Make sure that you understand nginx configuration and the pathways different requests take. To avoid 403 error, you can put empty index.html file in that directory.

Cloudinary direct unsigned upload with django

I am using the cloudinary sample django project:
https://github.com/cloudinary/cloudinary-django-sample
I made the following changes:
- using django 1.8.6
- using cloudinary 1.4.0
- added CLOUDINARY_URL environment variable
- added cloudinary_cors.html file (provided by cloudinary) in static/html directory
I can perform server-side upload and everything works fine.
When I perform browser upload (signed or unsigned), the image selected uploads to my cloudinary account successfully, but the cloudinarydone event never occurs and the browser doesn't resister a successful upload.
Instead, I am getting this error in the browser console:
XMLHttpRequest cannot load https://api.cloudinary.com/v1_1/[namespace]/auto/upload. The request was redirected to 'localhost:8000/static/html/cloudinary_cors.html?bytes=4304&created_a…s=%23%3CSet%3A0x0000000ab0e050%3E&type=upload&version=[num]&width=402', which is disallowed for cross-origin requests that require preflight.
I would think the POST doesn't require a preflight CORS request. I have seen other posts online about the preflight error, and it seems some of them were resolved by fixing javascript imports. My order is:
1. jQuery
2. uiwidget
3. iframe-transport
4. fileUpload
5. cloudinary.js
which seems correct based on said posts.
What am I doing wrong? What do I need to change to get the cloudinarydone event?
we're working on a fix for this issue.
Meantime, in upload.html you should replace the following line:
.fileupload({
with
.cloudinary_fileupload({
This should solve the issue for you.

403 Forbidden ONLY on javascript folder

I've been trying to trouble shoot this for 3 days and still can't figure it out after going through many other SO questions.
I'm setting up a DigitalOcean VPS using Apache 2.4.7. Setup for 2.4 is different from previous versions, so that may be part of my issue.
PROBLEM
I'm migrating from shared hosting, and trying to test my site on the new DO VPS. When I go to my new IP address, the site loads, but the following resources get a 404 error:
<link href="/javascript/jquery-ui-1.9.2.custom/css/smoothness/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<script src="/javascript/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.js"></script>
<script src="/javascript/dialog/alert_text.js"></script>
Resources in other folders are loading fine; for example, this stylesheet loads without issue:
<link rel="stylesheet" type="text/css" href="/styles/main_style.css">
I tracked down the issue to a 403 forbidden error on my /javascript directory. This directory is owned by the same owner/group and has the same permissions (755) as every other directory in my web root. But for some reason I cannot access /javascript from my web browser.
WHAT I'VE TRIED
The files do exist on the new server in that location. I've checked that the folder is correct, and that there aren't any strange capitalizations. Everything is working fine on the old server, and all I've done is copy and paste the directory structure to the new server.
There are no .htaccess files on the server. And the server wouldn't care if there were, because Alow Override None is set.
I've changed my apache2.conf back to the default state to make sure there are no strange <Directory> directives.
I added a <Directory> for the /javascript folder and did Require all granted.
I changed permissions on the /javascript folder to chmod 777 with no effect, then changed back to chmod 755.
I'm restarting the web server after each change, but nothing has any effect. I always get a 403 forbidden error on the /javascript directory, even though the owners and permissions are the exact same as every other directory in my web root.
Is there some way to get more info on the 403 error? Some way to find out why it's not allowing access?
Final note
One thing to note is that I haven't pointed my DNS to DigitalOcean yet since I'm still testing. So the client browser is loading from MY.IP.ADR.ESS/javascript/... rather than MYDOMAINNAME/javascript/.... I can't imagine that would matter, but thought I would mention it anyway.
I found the issue, and it's a known problem: Ubuntu BUG.
The problem was that the folder's name was "javascript", and the fix was simply renaming my /javascript folder to /java-script (or anything OTHER than /javascript).
Basically if you have the javascript-common package installed, it generates the following alias:
Alias /javascript /usr/share/javascript
So my WEBROOT/javascript folder was being redirected to /usr/share/javascript, giving the 403 error.
Hope this helps save someone else a few days of troubleshooting!