Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use PithHelmet to allow simple URL typing Apps
Recently, somebody in the DNS system started serving advertisements to me when I type in simple URLs, like foo. I used to get failed lookups, which would make Safari try to load http://www.foo.com, and I think try http://www.foo.org if that too failed. With the advertisement system, I feel like I'm using a Windows machine -- I have to type the whole thing out. Grr.

Enter PithHelmet. If you have this shareware add-on for Safari, you can rewrite the URL before it gets requested. This turns out to be even faster than the old way. Here is how to do it:
  1. Make a new Rule.

  2. Type the following in the URL field:
    ^(http://)*([^./]+)(/*)$
    This will match any text that lacks a period mark in it, optionally starting with http:// and optionally ending with /.

  3. Choose "Matching URL request action:" Transmogrify

  4. Enter the following in the Transmogrification Replacement field:
    http://www.$2.com/
I hope this helps some folks out. Other variations could be easily written to alllow replacement for *.org or *.edu (by typing, say, foo o or foo e in the location bar).
    •    
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[5,736 views]  

Use PithHelmet to allow simple URL typing | 14 comments | Create New Account
Click here to return to the 'Use PithHelmet to allow simple URL typing' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use PithHelmet to allow simple URL typing
Authored by: b00le on Oct 27, '05 07:45:28AM

I can't make this work. Where do I type the first expression - is the 'url field' the one in the column on the left? But then do I need to put anything in the 'Matching Pattern' field. (I've tried both, together and separately). Do I want a 'Wildcard Match' or one of the other options (none seem to work). Do I need to enable 'Site Preferences'? These may seem like a lot of stupid questions, but if you've never used the Rule Editor it's far from intuitive. I want this to work because some time ago Safari stopped expanding simple URLs for me altogether and I've never been able to figure out why. My failed lookups just stay failed.



[ Reply to This | # ]
Use PithHelmet to allow simple URL typing
Authored by: dhirsch226 on Oct 27, '05 09:00:48AM
Sorry, I should have been clearer. Here's more detailed instructions:
  1. Install PithHelmet
  2. Select Open Rule Editor from the menu
  3. Click the "New" button to add a new rule and give it a name
  4. With that new rule selected, in the box labeled "Matching Pattern" near the top of the window, type the following:
    ^(http://)*([^.:/]+)(/*)$
    PLEASE NOTE: I've added a colon after the period, to allow Safari to open the manage bookmarks view!
  5. Make sure the top menu is set to Regex URL Match
  6. Click the Filter button, and set the "Matching URL Request Action" menu to Transmogrify
  7. Set the Transmogrification Replacement (bottom text box) to
    http://www.$2.com/
Hope this helps!
-Dave

[ Reply to This | # ]
Use PithHelmet to allow simple URL typing
Authored by: b00le on Oct 28, '05 06:00:49AM
Nope - still doesn't work. I suspect this may be related to the fact that simple URLs are broken for me anyway. I can't remember when this happened, nor can I find a preference setting or anything which might account for it.

If I just type , eg, 'gizmondo', I get the message:

The requested URL could not be retrieved
While trying to retrieve the URL: http://gizmondo/
The following error was encountered:
Unable to determine IP address from host name for gizmondo
The dnsserver returned:
Name Error: The domain name does not exist.
This means that:
The cache was not able to resolve the hostname presented in the URL. Check if the address is correct.
Your cache administrator is help@xxxx.it.
Generated Fri, 28 Oct 2005 12:51:47 GMT by cluster2.yyyy.com (squid/2.5.STABLE10)
So perhaps the answer lies with the propellorheads who manage the internal system...
The http:// gets added, but not the .com

[ Reply to This | # ]
Use PithHelmet to allow simple URL typing
Authored by: dhirsch226 on Oct 28, '05 02:52:05PM

I think if you are getting that error, then somehow PithHelmet is not doing its thing for you. The great thing about PithHelmet is that the request for http:/gizmondo/ never goes out to the internet, so you could not be getting an error referencing that URL. I don't know why it's not working for you, but the problem is your PithHelmet installation, *not* the internet or DNS or your ISP.
-Dave



[ Reply to This | # ]
Use PithHelmet to allow simple URL typing
Authored by: sympleko on Oct 28, '05 10:08:20AM

This service--redirecting domain name service lookups to a web page rather than returning a not found message--is against DNS protocol. It breaks applications which decide whether a domain name is in use by doing DNS lookups (such as Safari!). ICANN and VeriSign (one of the companies that started the practice, and the organization which keeps nameservice information for .com and .net) have been in a bitter duel of lawsuits about it for the past two years. It was just settled, in fact.

The upshot of the settlement is that organizations which do domain name service will have to get changes to the implementation of DNS approved by ICANN. So this kind of thing shouldn't be happening suddenly.



[ Reply to This | # ]
Use PithHelmet to allow simple URL typing
Authored by: dhirsch226 on Oct 28, '05 02:56:56PM

I'm glad it's prohibited, but that doesn't change the fact that it's happening to me. I get it when I'm connected from home on my Comcast cable account. It's been going on for about three weeks or so. Sucks for me, but this thing helps.

(I tried doing the same thing with GreaseMonkey and Firefox, but the best I could do was kludgy and slow, because GreaseMonkey does not, as far as I know, let you munge URLs, only pages).
-Dave



[ Reply to This | # ]
Use PithHelmet to allow simple URL typing
Authored by: CaptainQueeg on Oct 31, '05 11:10:49AM
This broken DNS response seems to be unique to OSX for me.

From a linux box here at home:

slick@venus:~$ curl schwab
curl: (6) Couldn't resolve host 'schwab'

From an OSX box, same network:


minime:~ slick$ curl schwab
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="http://www.netidentity.com/?mp=DomainRedirect&d=schwab">here</a>.</h2>
</body></html>
Anybody have any insight on why OSX is redirecting to netidentity.com ?

[ Reply to This | # ]
Use PithHelmet to allow simple URL typing
Authored by: jdos2 on Nov 02, '05 06:02:47AM

I'd have to wonder who you are using as a DNS server- the Mindspring services don't allow me to resolve "schwab" with a redirect.

This is mostly an annoyance, and is indeed not appropriate root behavior, but it was worse a couple years ago when Network Solutions implemented it and broke surviving Windows 95 clients that ask for servers with a .com extension first... Bad Things happened.

---
2001 Moto Guzzi V-11 Sport
1999 Triumph Trophy (Shop Bike) 1200



[ Reply to This | # ]
Use PithHelmet to allow simple URL typing
Authored by: koncept on Oct 29, '05 11:25:32AM
^(http://)*([^./]+)(/*)$
Regarding the pattern above, don't you have to escape the single "." in the range you want to negate? My basic understanding of regular expression patterns led me to believe that an un-escaped "." translates literally to "any single character" and NOT a period exclusively.

I am not able to install this application or test the following regular expression given my current version of Tiger for some reason, but I was thinking something like this:

Match:

^(http://)?([^.:/]+)(.+)?$

Replace:
http://www.$2.com$3

Again, I have very little experience in the regExp world, so if anything here needs cleaned up, I would appreciate learning from any feedback...

[ Reply to This | # ]
Use PithHelmet to allow simple URL typing
Authored by: koncept on Oct 29, '05 01:00:34PM
Weird. The escape was stripped. Same thing probably happened to the orig poster.
^(http://)?([^\.:/]+)(.+)?$


[ Reply to This | # ]
backslash weirdness
Authored by: sjk on Oct 29, '05 04:01:05PM

Happened to me the other day. I'd triple-backslashed to insert a backslash, saw it correctly in a post preview, fixed it again in the post text before submitting, but it was stripped in the actual post. Funky.



[ Reply to This | # ]
backslash weirdness
Authored by: dhirsch226 on Oct 30, '05 05:24:30PM
Yes, that seems to have happened to me when I submitted this. Perhaps some problem with Rob's data-flow pathway. The current URL field should look like this with no spaces, and with the correct symbols substituted for the all-caps words:
^(http:BACKSLASH/BACKSLASH/)*([^BACKSLASH.:BACKSLASH/]+)(BACKSLASH/*)$

(let's hope this works right)

[ Reply to This | # ]
Use PithHelmet to allow simple URL typing
Authored by: Bobson on Nov 01, '05 02:44:06PM

I'm pretty sure that a . in a character class (the brackets), means a '.' instead of it's usual meaning of 'any single character'. If you think about it, it doesn't make much sense to allow a character class to match one *anything*, or fail to match one *anything*...



[ Reply to This | # ]
How about a non-broken DNS-server instead ?
Authored by: voldenuit on Oct 29, '05 04:44:58PM

Note that you are not required to use nameservers that do questionable things.

There are lots of working, freely accessible servers out there, google yourself a list and find a couple near you and use those instead of the broken ones.



[ Reply to This | # ]