Custom Domains in Chrome - google-chrome

I've got a vhosts file set up for my local machine where I use a made up domain (cascade.mtn) with a bunch of subdomains (rainier.cascade.mtn, hood.cascade.mtn, etc). In every other browser I can hit those domains just fine but in Chrome it just takes me to a Google search.
Is there anyway to force Chrome to recognized the cascade.mtn domain?

Old question, but posting answer since I ran into the same thing.
If you add a trailing slash (/) to the end of the URL, it will hint Chrome to treat it as a URL, which is what you want. From that point, it will 'learn' that that is indeed a valid URL and you won't require the trailing slash anymore.

Related

Treat insecure origin as secure

The domain localhost is treated as a secure origin by default, which is very handy when testing webapps locally.
It let's you use features like getUserMedia without having to use the https protocol.
Because crostini uses the domain linuxhost instead of localhost, it isn't treated as a secure origin.
There is a chrome flag, chrome://flags/#unsafely-treat-insecure-origin-as-secure, that lets you set new domains to be treated as secure, but I've tried all of the following, and everytime, when I restart chrome, the input is empty again.
linuxhost
http://linuxhost
http://linuxhost:3000
http://linuxhost:3000/
plus all the other combinations of http://, linuxhost, :3000, and /.
There are some threads about treating linux.test as secure and changing linuxhost to linux.test but those are pretty recent and don't work yet.
Has anyone managed to get that flag to work on chrome os.
I've seen other answers that show how to set this flag, but only via the command line, not through the chrome UI.
I'm on the dev channel with crostini working, on version 69.0.3473.0

Why does an HREF consisting of a plain forward slash direct to the homepage?

I came across an HTML anchor which reads Home.
Normally we put something like Home but when I click on Home I am able to go to the index page on the website.
I can't replicate the behavior on localhost.
Why does \ direct to the website's homepage, and was it intentional on the developer's part?
You are correct that it is incorrect, and it's almost certainly not intentional. Backslashes (\) are considered unsafe in URLs, and if a backslash is necessary in your URL you would normally have to encode it as %5C.
Why it works
As Rocket Hazmat pointed out in a comment on your question, most browsers automatically substitute / for \ in URLs.
So the link to \ is converted to /, which requests the root of the current server. The server is probably set up to serve some default file like index.php when it receives a request for a directory, and the result is loading the homepage.
Why it doesn't work in localhost
I don't know your local http server setup, but chances are it hasn't been configured to serve a specific page (like index.php) when it receives a request for a directory. So you are likely just seeing a directory listing of whatever is at the root of the local http server you are running locally.

chrome wont let me access localhost (it google searches instead)

How can I disable chrome using address bar for google search?
I cant access localhost at 0.0.0.0:6000, because chrome thinks it's a google search and not an url
any ideas?
This may be because a url was added to your search history. Google is doing you a favor because that's what you did once before somehow.
Try clearing your history to see if this is the case.
I went to "Clear Browsing Data" in Settings > Advanced and I was able to enter a localhost url again.
Be sure you end the url with "/" symbol.
Try:
http://0.0.0.0:6000/
Instead of:
0.0.0.0:6000
SOLUTION For chrome version 62:
settings > advanced > Use a web service to help resolve navigation errors > OFF
Try
- turn off Search Suggestions
- under LAN settings, uncheck "use automatic configuration"
Do you get the same behavior with an incognito window?
Try this alternative: http://127.1.1.1:6000 or 127.1.1.1:6000 (without http).
A search through the web has revealed several different possible causes to this problem as well as solutions.
Causes:
this is malware
this is a chrome/browser issue
this is a misconfiguration of the httpd service
Solutions:
scan for malware, though probably not the issue.
update the host file, so that localhost points to 127.0.0.1
confirm your httpd service is accepting http:// requests through port 80, 8080, or some other port.
make sure the URL has the correct port .. http://localhost:8080
try appending different delimiting characters [ / ? # ] to the URL ...
localhost/Dir/
localhost/Dir?p=x
localhost/Dir#123
does it happen on a specific directory?
localhost/Dir .. works
localhost/Dir2 .. goes to search.
This suggests that the httpd service's configuration may need to be fixed. or that an .htaccess file is the cause. If these problems can be ruled out, then it's a browser issue.
remove the autocomplete entry from the browsers search/address bar
in most cases, type the url, using the arrow keys - highlight the offending entry, press [DELETE] or [SHIFT}+[DELETE].
does your browser support turning off autocomplete or searching from the address bar?
.. chrome .. Disable Predictive Text
.. firefox .. Disable Predictive Text
open the CLI and issue [ >wget localhost/dir ]. Observe what is returned on a working vs non working directory.
Follow up:
This issue is especially annoying when working with .htaccess files and browser redirect statements in PHP, ASP, nodeJS, and JSP which redirect the browser to a specific URL, but instead takes the user to a search page. If at all possible pre-pend http:// and post-pend a slash (/) after the URL in redirects.
http://localhost/dir/
And, YES ... it is annoying to have to add extra characters (as a work around) to get URLs to work right.
I might be a bit late to the party here but I just encountered this same problem on the current chrome (v. 96.0.4664.93) and could it would not resolve any local address using any of the other methods that I found on the web(http://192.168.178.1 or setting flags or insecure DNS).
What solved the problem, was a simple "/" at the beginning of the query string.
Whenever I enter
/192.168.178.1
into the Omnibox and hit enter it works for all services.
If some other people could verify this - I'd be really happy to get some feedback on this approach.
I have this problem often myself. First, go to just localhost, chrome should understand that, then, when you type in localhost/my/url/here, the context will allow chrome to understand to treat it as a url.

Opening a folder through FireFox with HTML

I recently built a HTML and Javascript web application that opens specific folders throughout a network of accessible drives. This app works well when it is rendered in IE; however, the folder paths do not work in FireFox.
The following is an example of the path format that I am using to open the folders in IE:
{
window.open('\\\\Server-1\\Folder-1\\Folder-2');
}
The path actually has 4 backward slashes at the beginning and 2 bakcward slashes between each folder. It appears different when rendered.
When I run this app in FireFox, the window or new tab appears, but there is nothing rendered. I've manually entered the path and FireFox converts it to: file://///Server-1/Folder-1/Folder-2. Does anyone know what the correct syntax would be (i.e. window.open(?...))?
Here is something that might help you. It is considered a security risk by Mozilla.
http://kb.mozillazine.org/Links_to_local_pages_do_not_work
according to Daniel's link you need THREE forward slashes not FOUR for local paths...
Path Syntax
You also need to use proper URI syntax
for local file references. It is not
proper to enter an
operating-system-specific path, such
as c:\subdir\file.ext without
converting it to a URI, which in this
case would be
file:///c:/subdir/file.ext. In
general, a file path is converted to a
URI by adding the scheme identifier
file:, then three forward slashes
(representing an empty authority or
host segment), then the path with all
backslashes converted to forward
slashes.

Subdomains do not work without the leading www

What is the difference between the following URLs?
http://www.forums.example.com and
http://forums.example.com ?
Actually I've created a new subdomain in my website and it's working fine when I try to access without www (i.e http://forums.example.com) But when I try to give URL like http://www.forums.example.com it is showing "Page not found".
Why is this and how can I fix the issue?
If I am not mistaken, www. is also considerd a Subdomain, hence when you setup hosting on a provider (i.e Slicehost) they tell you to put www in the subdomain list (again if I am not mistaken). If you really want www.fourms.duckyetc you can set up a script to do some matching, i.e
if url contains www.fourms.ducketc then go to here else go somewhereelse
You have to create a cname for www.forums.duckyvideos.com and also configure your webserver to respond to that cname. There is nothing automatic about www prefixes on the web. It's just a convention that websites are accessible with or without the www. Everyone hosting a website has to explicitly set up a second cname for the www prefixed version of every site they put up.