404 error page redirection - subdomain

I've setup a custom 404 error page using the following code.
ErrorDocument 400 /errors.php
But when I check the headers sent i see that first a 301 moved permanently is sent followed by a 404 error header. So is it good for seo will it create problem with bots.
My second question is reg. transfer of non-existent sub-domains to 404 error pages.I'm using Cpanel and i want only the subdomains created in CPanel to work and i've created a wildcard redirect but non existent subdomain gives me a OK status.How do i redirect it to 404 page.
Thanks.

googlebot-news has special requirements published recently, like they won't acept old site schema-s any more

Related

Is someone also getting this error in Chrome 87.0.4280.88?

"The information you’re about to submit is not secure
Because the site is using a connection that’s not completely secure, your information will be visible to others."
We have started receiving this error today. I thought that this is a certificate problem, but it's secure
[]
Also there no warnings and errors in console page
What do you advise to do?
Same problem from today on chrome 87.0.4280.88.
Cert is ok and all assets are loaded over https.
My login forms are triggering this warning message, the form action url is relative so it's supposed to be sent over https too, don't know why this message is triggered...
Maybe try with absolute https action url.
[edit]
Check this tread -> https://support.google.com/chrome/thread/88331714?hl=en
For me it was the scheme on the location header when redirecting after successful login that was misconfigured on the reverse proxy, the app was sending back on http.
Fixed by adding these headers on reverse proxy conf on Nginx :
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port 443;
Make sur that your app is aware of these headers too.
For example in a symfony app -> https://symfony.com/doc/current/deployment/proxies.html
This problem disappeared. I think they solved this problem, and now we don't have it)

WebTorrent Broken

I'm trying to figure out how to get web torrent to play a video, but I'm getting some weird errors. Here is a pastebin: https://pastebin.com/raw/3wp5F8Fh
And here is a live version: https://41182065-e8d9-40b1-8dd9-9433b402bce9.htmlpasta.com/
When we go to the chrome console, we get this:
Mixed Content: The page at 'https://41182065-e8d9-40b1-8dd9-9433b402bce9.htmlpasta.com/' was loaded over HTTPS, but requested an insecure script 'http://momentjs.com/downloads/moment.min.js'. This request has been blocked; the content must be served over HTTPS.
/favicon.ico:1 Failed to load resource: the server responded with a status of 404 ()
(index):1 Access to XMLHttpRequest at 'https://nyaa.si/download/941788.torrent' from origin 'https://41182065-e8d9-40b1-8dd9-9433b402bce9.htmlpasta.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
webtorrent.min.js:4 Uncaught Error: Error downloading torrent: XHR error
at webtorrent.min.js:5
at t.exports.<anonymous> (webtorrent.min.js:7)
at t.exports.t (webtorrent.min.js:5)
at t.exports.r.emit (webtorrent.min.js:4)
at XMLHttpRequest.c.onerror (webtorrent.min.js:7)
The explanation is in the error message, but in short: your browser has blocked the request because you're using AJAX to communicate with a remote server and that server isn't sending the appropriate 'Access-Control-Allow-Origin' header.
The reason such requests are blocked is to protect you from malicious scripts - if you're logged in to website A and have access to some private data, then website B shouldn't be able to trigger an AJAX request to access that data unless A trusts B.
The general term for this kind of access is 'Cross Origin Resource Sharing' or 'CORS' - for more information, Mozilla have a nice summary here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
If you have control of the remote server then responding with the appropriate header will allow the request to go through (although note that some browsers such as Safari will still block cookies from the remote server because this technique can be used for tracking).

Dnsmasq failing to catch 307 redirect for https?

I am currently doing some debugging on my website which involves calling the facebook API. I've installed dnsmasq to work with my mac os X to redirect all request to facebook.com to 127.0.0.1
This is my entry in dnsmasq.conf:
address=/facebook.com/127.0.0.1
I also have /etc/resolver/com with nameserver 127.0.0.1
When I turn dnsmasq on, visiting facebook.com will result in a PAGE NOT FOUND error in chrome. This shows that my dnsmasq is working.
However, I noticed that chrome will redirect http://www.facebook.com to https://www.facebook.com due to HSTS. I went on to chrome://net-internals#hsts to delete facebook.com's entry.
The strange thing is, when I am debugging, I see that facebook.com is indeed returning 307 redirects for http://www.facebook.com (See image)
This is very strange because the domain facebook.com is currently resolved to be 127.0.0.1 on my computer! Furthermore, when I dig more into the request, I do see that the request is valid:
Where is this 307 redirect coming from if facebook.com is unresolvable?
307 is an internal browser based redirect for HTTP Strict Transport Security (HSTS). It does not come from the server - it's a fake response created by the browser.

ErrorDocument 403 custom page not displays

I've blocked all IP's except my own from an old website, I've added a custom HTML page to replace the default 403, but it's not displaying?
order deny,allow
deny from all
allow from (ip)
allow from (ip)
ErrorDocument 403 http://www.mywebsite.co.uk/error.html
I can access the html page in my browser by visiting www.mywebsite.co.uk/error.html but from a blocked IP it still displays the standard 403 error message
Any ideas?
Thanks

How do I change a 500 error into a 404 error and show a custom page?

I just launched a site and when I go to a non-existing page, I get a 500 Internal Server error instead of a 404 errror.
I was thinking that this was because I didn't have a 404.html page (just a guess), but I just created a 404.html page at the root and I still get 500 errors.
What should I do to make it so that when somebody types in a bad address they get redirected to my custom 404 error page?
There is no special stuff going on with my site, just HTML, CSS and a tiny bit of javaScript. Not a Rails app, not a Wordpress site, no PHP, etc. ..just HTML files on an Apache server.
The error I get when I go to a non-existing page or directory reads like this"
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator,
webmaster#subdomain.domain.com and inform them of the time the
error occurred, and anything you might have done that may have caused
the error.
More information about this error may be available in the server error
log.
Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.
After you have the Error 500 problem solved you can create a custom 404 page by editing your .htaccess file you should have one in the root of your directory.
Open the file with a text editor and add this:
ErrorDocument 404 http://www.yourwebsite.com/404page.html
You could also create a custom Error 500 by changing the above code to suite your needs.
It's pretty self explanatory but the last part is the directory that users will be directed to after they receive a 404 error.