Google Hacks Free Open Book

Google Hacks

Previous Section Next Section

Hack 14 inurl: Versus site:

figs/beginner.giffigs/hack14.gif

Use inurl: syntax to search site subdirectories.

The site: special syntax is perfect for those situations in which you want to restrict your search to a certain domain or domain suffix like "example.com," "www.example.org," or "edu": site:edu. But it breaks down when you're trying to search for a site that exists beneath the main or default site (i.e., in a subdirectory like /~sam/album/).

For example, if you're looking for something below the main GeoCities site, you can't use site: to find all the pages in http://www.geocities.com/Heartland/Meadows/6485/; Google will return no results. Enter inurl:, a Google special syntax [Section 1.5] for specifying a string to be found in a resultant URL. That query, then, would work as expected like so:

inurl:www.geocities.com/Heartland/Meadows/6485/

While the http:// prefix in a URL is summarily ignored by Google when used with site:, search results come up short when including it in a inurl: query. Be sure to remove prefixes in any inurl: query for the best (read: any) results.

You'll see that using the inurl: query instead of the site: query has two immediate advantages:

  • You can use inurl: by itself without using any other query words (which you can't do with site:).

  • You can use it to search subdirectories.

14.1 How Many Subdomains?

You can also use inurl: in combination with the site: syntax to get information about subdomains. For example, how many subdomains does O'Reilly.com really have? You can't get that information via the query site:oreilly.com, but neither can you get it just from the query inurl:"*.oreilly.com" (because that query will pick up mirrors and other pages containing the string oreilly.com that aren't at the O'Reilly site).

However, this query will work just fine:

site:oreilly.com inurl:"*.oreilly" -inurl:"www.oreilly" 

This query says to Google, "Look on the site O'Reilly.com with page URLs that contain the string `*.oreilly' (remember the full-word wildcard? [Hack #13]) but ignore URLs with the string `www.oreilly'" (because that's a subdomain you're already very familiar with).

    Previous Section Next Section


         Main Menu
    Main Page
    Table of content
    Copyright
    Dedication
    Credits
    Foreword
    Preface
    Chapter 1. Searching Google
    1.1 Hacks #1-28
    1.2 What Google Isn't
    1.3 What Google Is
    1.4 Google Basics
    1.5 The Special Syntaxes
    1.6 Advanced Search
    Hack 1 Setting Preferences
    Hack 2 Language Tools
    Hack 3 Anatomy of a Search Result
    Hack 4 Specialized Vocabularies: Slang and Terminology
    Hack 5 Getting Around the 10 Word Limit
    Hack 6 Word Order Matters
    Hack 7 Repetition Matters
    Hack 8 Mixing Syntaxes
    Hack 9 Hacking Google URLs
    Hack 10 Hacking Google Search Forms
    Hack 11 Date-Range Searching
    Hack 12 Understanding and Using Julian Dates
    Hack 13 Using Full-Word Wildcards
    Hack 14 inurl: Versus site:
    Hack 15 Checking Spelling
    Hack 16 Consulting the Dictionary
    Hack 17 Consulting the Phonebook
    Hack 18 Tracking Stocks
    Hack 19 Google Interface for Translators
    Hack 20 Searching Article Archives
    Hack 21 Finding Directories of Information
    Hack 22 Finding Technical Definitions
    Hack 23 Finding Weblog Commentary
    Hack 24 The Google Toolbar
    Hack 25 The Mozilla Google Toolbar
    Hack 26 The Quick Search Toolbar
    Hack 27 GAPIS
    Hack 28 Googling with Bookmarklets
    Chapter 2. Google Special Services and Collections
    Chapter 3. Third-Party Google Services
    Chapter 4. Non-API Google Applications
    Chapter 5. Introducing the Google Web API
    Chapter 6. Google Web API Applications
    Chapter 7. Google Pranks and Games
    Chapter 8. The Webmaster Side of Google
    Colophon
    Index


    More Books
    PHP Hacks
    Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
    The Koran (Holy Qur'an)
    Macromedia Flash 8 Bible
    Search Engine Optimization for Dummies
    YouTube Traffic
    PHP 5 for Dummies
    Harry Potter and The Chamber of Secrets
    Harry Potter and the Sorcerer's Stone
    The Pilgrim's Progress
    Wireless Hacks
    Flash Hacks. 100 Industrial-Strength Tips & Tools
    PayPal Hacks. 100 Industrial-Strength Tips and Tools
    Amazon Hacks
    Pdf Hacks
    The Da Vinci Code
    Google Hacks
    The Holy Bible
    Windows XP For Dummies
    Harry Potter and the Half-Blood Prince
    Seo Book
    Upgrading and Repairing Networks
    Macromedia Dreamweaver 8 UNLEASHED
    Windows XP Annoyances
    Windows XP Hacks
    Microsoft Windows XP Power Toolkit
    Teach Yourself MS Office In 24Hours
    iPod & iTunes Missing Manual
    PC Hacks 100 Industrial-Strength Tips and Tools
    PC Overclocking, Optimization, and Tuning - 2th Edition
    PC Hardware In A Nutshell 3rd Edition
    PC Hardware in a Nutshell, 2nd Edition
    Upgrading and Repairing PCs
    Google for Dummies
    MySQL Cookbook
    Teach Yourself Macromedia Flash 8 In 24 Hours
    PHP CookBook
    Sams Teach Yourself JavaScript in 24 Hours
    PHP5 Manual
    Free Games Paper Airplanes
    500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele