Website not available unless www is in front of the url in Chrome browser are there any tricks to fix this? - browser

My website is accessible without www in the front of it in Firefox and Safari however for some reason it is not in Chrome. Is there anything that I need to change on my website host or in the html to make it accessible?

If your website is not already set up to do so, you'll need to update your web host to respect requests for http://your-website.com as well as http://www.your-website.com.
Firefox (and apparently Safari) will make a second request to a URL using or removing the www. in front of it if they receive a 404 error before displaying any resulting errors to the user. (And if the alternate URL works they will display the results of the second request and silently drop the results of the first [the 404 error].) Most, if not all other browsers will just display the first 404 error page.
What web server are you running on?

Related

5 characters appearing in URL

I've been having an issue off and on, hard to reproduce, but happening reasonably regularly.
I have static files on Azure blog storage, and here's the setup - a lot of steps to set up, but it works most of the time - I used this blog as my guide:
index.html lives on the "webfiles" container in blob storage
the CDN points to /webfiles
there's a URL rewrite in the CDN setup from / to /index.html
DNS redirects http://example.com to https://www.example.com
DNS for www points to the CDN URL
When I go to http://example.com, 9 times out of 10, it properly redirects to https://www.example.com/ and loads the index.html page. However, sometimes, and it seems to generally be on a clean browser with no history, it'll send me to something with 5 extra characters, like https://www.example.com/VeVPe/ where I get a 404 and a BlobNotFound exception - I have no idea what VeVPe is, and it seems to be different for different sites. I have 5 sites set up like this, and it happens to all of them.
If I remove that 5-letter (always seems to be letters, never numbers, but that could just be coincidence) and hit ENTER, it loads properly and I get index.html, or if I just try http://example.com a second time, it works properly. Just seems to be one time.
I've also seen it happen to other sites in the public - there's a local school where the website sometimes redirects me to http://www.example.com/LNnZS/ and a 404 page - that one seems to be the same thing, but it's not HTTPS, so that seems to eliminate at least some of the possible causes. I don't know who their DNS or hosting providers are, so I don't know if it's specific to Azure or GoDaddy.
This happens on Chrome and Edge on desktop and Safari on iPhone, so it's not a browser or computer issue.
If it helps, here's what the URL redirect and rewrite look like on Azure:
EDIT I'm seeing something interesting when I can catch it in browser tools:
The initial request to http://example.com goes to GoDaddy's IP and returns a 302 Found to Location /KVZQZ/. Then there's a request to http://example.com/KVZQZ/ which is returned by GoDaddy's IP with a 301 with a Location https://www.example.com/KVZQZ/, and the third request actually makes it to Azure's IP which returns the 404 for BlobNotFound.
So to me, this looks like it's a DNS problem, not a problem with Azure. My DNS settings are:
A # Forwarded to https://www.example.com
CNAME www example.azureedge.net
On the forwarding section of the DNS setup, it just forward to https://www.example.com with a 301 forward type. So from what I can tell, nothing too funky here.
After a lot of Googling - This forum post shows lots of people who have had the same problem where 5-letter codes get added to their site. It's apparently specific to GoDaddy and no one has been able to convince them to address it. Their workaround is to throw a query string on the forwarding address.
I changed the forwarding address from https://www.example.com to https://www.example.com? and it's working ok now.
I made a request in the browser to http://example.com and it redirected me to https://www.example.com/?/MKSTc/ and loaded up the index.html page - obviously this is not ideal because it's ugly, but I suppose I can write some javascript to do a second redirect back to https://www.example.com/

URL is always on index even though you're in different page

I have a website and it always in www.website.com/index even though I am in different page but in my localhost, the URL is changed, my server is LINUX based. I also used cakePHP framework. It happens in Chrome Browser, in Firefox, the URL is changed.

Image URL being redirected to other web site

I am trying to use an image from an existing website in my html page. The issue is that the image is not getting resolved correctly, Even when I hit the image URL directly on browser, its getting redirected to some other site. I have tried on all browsers but no luck.
I have heard about restricting resource using hot linking but in this case not sure whats happening. Any pointers/suggestions please.
Eg - I want to use image(http://www.acsisair.com.au/wp-content/themes/acsis-air/images/logo.png) but when hitting this URL after clearing browser cache, its being redirected to other website (http://www.nine.com.au)
It's very, very likely a form of hotlinking protection: if you change the URL subtly to make it clearly incorrect, you get a 404 page.
That means when you enter an URL to a resource that exists, you're given a header redirect. That's not an accident.
There's likely nothing you can (or should) do to circumvent this.
Use images you can host on your own site.

Getting redirected URL in python 3

I want to get the address of a page after redirect. I have the following code
url = 'https://simple.wikipedia.org/wiki/Gcd'
print(urlopen(url).geturl())
But it doesn't work, it prints https://simple.wikipedia.org/wiki/Gcd, while it should print https://simple.wikipedia.org/wiki/Greatest_common_divisor.
So, what is the problem with it?
There is actually no problem. The URL you get when opening https://simple.wikipedia.org/wiki/Gcd is exactly that URL. The only way for the URL to change would be a redirect, and if you look at the response from that URL, you can see that it returns just a 200 status code. So there is no redirect.
However, when you open the URL in the browser, the URL does get changed to https://simple.wikipedia.org/wiki/Greatest_common_divisor. How does this happen when there is no redirect?
This is actually a new MediaWiki feature that rewrites the URL in the browser using the History API. It simply replaces the URL that is displayed in the browser—but without actually making a new request or being a true HTTP redirect.
It’s a functionality that only works in modern browsers with JavaScript enabled. Otherwise, you would stay on the Gcd URL which is also the behavior from older versions of MediaWiki.
You can learn more about this new MediaWiki feature in the Phabricator task T37045.
As for your “problem” with it, you should consider communicating with MediaWiki using the MediaWiki API which will also tell you when a page is a redirect.

How to identify mixed content in https website

I've inherited an ASP.NET web site that has an SSL certificate bought via GoDaddy.
The problem is that the certificate seems to be invalid because of some "mixed content/resources" (I think that's how its called) coming from http sites.
Chrome is showing the red cross over the lock next to https, meaning it's unsecured. The popups says the following:
Click in "What do these mean?" goes here which says:
The [crossed-lock] icon appears when
Google Chrome detects high-risk mixed
content, such as JavaScript, on the
page or when the site presents an
invalid certificate.
The certificate is correct and valid because I tried creating a blank "Hi world" .aspx page and it's showing the green lock with no problems.
Reading a little bit, I found that I should only include images and javascript coming from https sites. The only thing it had coming from http was the addthis widget, but they support https, so I changed to https, but it's still saying that is unsecured.
I've searched for anything else coming from http in the source, but didn't find anything.
Is there some way (site, chrome extension, firefox extension, whatever) that will show exactly which are the resources that are "unsecured"?
I've never dealt with SSL/HTTPS certificates, but I need to fix this issue asap.
Check your site in http://www.whynopadlock.com, which will give you a list of url which is not consider as secure by your browser.
Check the chrome console
You will get it like this,
The page at https://xys displayed insecure content from http://asdasda.png.
Make it http site to https then it will work.
I've found the problem using the Chrome Developer Tools. It was a js that's embedding a flash from an 3rd party site which it's using http.
Are you on Windows? Download and run Fiddler while browsing the site, and watch for HTTP connections.
Mixed content means contents of a web page are mixed with HTTP and HTTPS links.
These links include your JS, CSS, Image, Video, Audio, Iframes etc.
If your website is enabled for HTTPS (SSL certificate has installed), make sure you serve only HTTPS contents throughout your web page.

Resources