Google Cloud Storage Hide/Modify Access Deny page - google-cloud-storage

When visitor access to directories, I dont want the page to show XML error message.
See below:
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>
Anonymous users does not have storage.objects.get access to object cdn.example.com/avatars.
</Details>
</Error>
I wonder if I can hide/modify the error page via gsutil or google console.

GCS's support for web pages is pretty basic. You can set a custom home page, and you can set a custom 404 page, but that's it.
If you really need to handle a user browsing to a subdirectory by hand, you could perhaps create custom HTML files named, for instance, "avatars" and "avatars/". That might be a pain to maintain, but it'd probably work.

Related

Unable to read sitemap: Google Search Console

Sitemap could not be read
General HTTP error
1 instance
We encountered an error while trying to access your Sitemap. Please ensure your Sitemap follows our guidelines and can be accessed at the location you provided and then resubmit.
Examples
HTTP Error:500enter image description here
Refer to the posts:
https://www.searchenginejournal.com/gsc-reports-sever-500-errors/375791/#close
https://support.google.com/webmasters/thread/66363365?hl=en
There can be errors in the code of the page or the structure. Google has set certain parameters based on which it decides to validate the submitted URLs and sitemaps.
It will be better if you can share the link of the problematic page so that one can try to catch what might be the issue.
For example:
https://paragpallavsingh.com/sitemap.xml, this is an autogenerated sitemap by WordPress. and submitted in Google search console without any issue.

How do I disable or redirect a php page unless its hot-linked?

I have a page called club.php. I want to disable people from being able to see my webpage if they type in www.mysite.com/club.php unless they are linked from another page. I have a page where you need to enter a password to access this.
I'm hoping I can simply drop code into my pages (javascript or something?)
There is an HTTP header called Referer, which contains the URI of the site from which the request to your site originated from. You can read the content of this header in PHP via $_SERVER["HTTP_REFERER"] (see http://php.net/manual/en/reserved.variables.server.php).
But please be aware that you can't rely on that this header field is set or not, so testing against the content of the header is not a serious security measure for protecting a particular page from beeing viewed from unauthorized visitors. You can set/unset the value of the header to any arbitrary value with your Browser or Addon.

Access Denied from aweber redirect

One of my pages in my domain is set up as a redirect from aweber, so when I confirm on the link on an email optin from aweber it redirects to this page MyPage.html and includes a welcome message with the name I signed up with.
Now granted I am not sure if this is something to do with aweber set up for redirect although it's very easy to do (basically paste the URL in settings you want to redirect to) and I have double/triple checked it. I also contacted aweber support who said it can be the javascript for personalisation embedded in the Head section of the redirect page that can cause this error. I have removed this code and can confirm it is not the javascript or redirect causing it hence my appearance here.
I also have another portion of the site using this redirect and personalisation and it works fine.
Now when I click on the link in my email from aweber it gives me this error:
Forbidden
You don't have permission to access /mypage.html on this server.
Additionally, a 500 Internal Server Error error was encountered while trying to use an >ErrorDocument to handle the request.
And the redirect URL is below so I can see it is redirecting with my details ok but failing to give me access to the page.
mysite.com/mypage.html?email=myemail%40yahoo.co.uk&from=myemail%40yahoo.co.uk&meta_adtracking=my_web_site&meta_message=1001&name=MyName&unit=MyAweberListName&add_url=http%3A%2F%2Fwww.MySite.com%2FthankyouPage.html&add_notes=xx.xx.xx.xxx
All my pages have access permission 644 and the page is a copy of one of my other pages, which works fine, I've not added anything, changed anything, only removed text lines and graphics.
I just also tried remaking the landing page and it failed once more. Funnily enough though when I manually type the page into the URL bar up it comes; this worked before with the original page as well!
This works:
mysite.com/mypage.html
This [redirect] doesn't and gives the error described above
mysite.com/mypage.html?email=myemail%40yahoo.co.uk&from=myemail%40yahoo.co.uk&meta_adtracking=my_web_site&meta_message=1001&name=MyName&unit=MyAweberListName&add_url=http%3A%2F%2Fwww.MySite.com%2FthankyouPage.html&add_notes=xx.xx.xx.xxx
Any ideas on getting to the bottom of this would be greatly appreciated.
Host is hostgator

Apache Authentication Refresh

I am trying to get a simple CGI website set up with Perl that creates an HTML page that links to a Java applet. I have managed to set this up, but for some reason, the Apache authentication for the site is doing some wonky things. Namely, if the password was entered incorrectly, instead of redirecting to a 403 page (as I assumed it should), it just refreshes the page - bringing up the password prompt again. My htaccess file looks as follows:
AuthUserFile PATH/TO/HTPASSWD
AuthGroupFile /dev/null
AuthName NAME
AuthType Basic
require user USER1
and it is located in the Java applets directory (different from the CGI directory). I have been looking around as to why this problem occurs, but I can't seem to find a reason the page would be refreshed. Does anyone know if this behaviour is typical if a Perl CGI program is trying to access an applet with .htaccess in the applet folder? Thanks beforehand.
It returns the more appropriate 401 Unauthorized error. The response includes the authentication method (Basic). Browsers respond to that by displaying a login prompt. (I believe the browsers give you a 401 error page after a few attempts.)
This is appropriate behaviour. You want to the user to be given another chance to enter his user/password. The real problem is that you can't customize the error to include other links (for example). The name "Basic" is merited.

Why does Object debugger say my URL is a facebook URL and isn't "scrapable"

In trying to create an "object" page for my first facebook app, I've run into some difficulty. I followed Facebook's Open Graph Tutorial nearly exactly.
After creating an "object" html page with the appropriate <meta property="og:... tags I tried running the URL through the Debugger Tool as suggested in the tutorial but I'm given the following error:
"Facebook URLs aren't scrapable by this Debugger. Try your own."
This page is in the same directory on my company's linux box as the canvas page, and is certainly not a "Facebook URL". If it matters, I'm using an IP instead of a domain name: xx.x.x.xxx/app/obj.html
...
I continued the tutorial anyway, but ultimately it does not seem to want to post a new action/object (is this even right?). I did however manage to get something to work, as in the app timeline view I apparently actioned one of those objects a couple hours ago. I assume this happened when I was pasting curl POST commands into the terminal.
I'm pretty new to the whole open graph, and facebook APIs, etc., so I'm probably operating under false assumptions of some sort, and I've been all over trying different things, but this error seems pretty bizarre to me and I can't seem to resolve it.
UPDATE
I just took the object page and put it on my own personal shared hosting acct. The debugger worked (inexplicably) fine on it, but I couldn't go too far since it's a different domain than the one authorized by my app.
Make sure og:url inside your html page does not point to facebook.
Also, make sure to look at the open graph protocol page (to see you formatted the og tags correctly.
Also, make sure the page is accessible to everyone, not just yourself.
Without knowing the URL it's hard to be sure, but it's most likely that your URL is either including a og:url tag pointing to a facebook.com address, or a HTTP 301/302 redirect to Facebook instead