Hidden-city ticketing can save significant money on airfare. Justin Sullivan/Getty Images

United Airlines and travel search engine Orbitz are none too happy with 22-year-old Aktarer Zaman. The 2013 Rensselaer Polytechnic Institute computer science graduate is the founder of Skiplagged.com, a website that helps travelers take advantage of an airline pricing loophole called “hidden-city ticketing.” The two companies are so threatened by the practice, they are suing Zaman for using his site to “intentionally and maliciously interfere” with United’s and Orbitz’s business practices.

So what exactly is hidden-city ticketing? As the lawsuit itself states, “a passenger purchases a ticket from city A to city B to city C but does not travel beyond city B.” That’s because a nonstop flight to certain destination sometimes actually costs more than booking a multi-stop ticket that just happens to have a layover at the destination a flier actually wants to visit. For example, say you want to fly from Boston to Chicago. A direct one-way flight might cost $250, while a one-way flight from Boston to Madison, Wisconsin, that’s routed through Chicago may only cost $125. To save $125, a traveler can purchase the ticket to Wisconsin but just not take the last leg of the flight.

According to travel lawyers, hidden-city ticketing isn't exactly illegal, though most airlines forbid the practice in their contracts of carriage. In a letter to customers, American Airlines says, “Although the issuance and usage of hidden city tickets is not illegal in the sense that one could be fined or sent to jail by the government, it is unethical and a breach of a passengers contract with AA.”

Randy Petersen, publisher of InsideFlyer magazine, said savvy frequent fliers do take advantage of the hidden-city booking technique, but limit it to a few times a year so that they’re not caught. Petersen said that an airline could freeze a traveler’s frequent-flier account or take away their miles if they are detected.

Zaman has raised more than $35,000 to fund his legal defense through GoFundMe.com and plans to fight the lawsuit. Another hidden-city ticket search engine, FlyShortcut.com, has suspended its operations because of the lawsuit against Skiplagged.com.

But the truth is, you don’t need these search engines to find a cheaper hidden-city ticket. Consumers can search for them directly on a site like Kayak.com. The process just requires searching for different fares through trial and error. Start by checking the price of a direct flight to your desired destination. Then, use Kayak’s “multi-city” search option to check fares for flights that offer your desired destination as a layover. Or simply search for flights to a location you know routes through desired city.

Here are some tips to keep in mind if you want to try hidden-city ticketing for yourself:

Buy two one-way tickets rather than a return. If you miss any part of your original itinerary, the airline can cancel the return portion of your ticket. That’s why hidden-city ticketing requires that you book return trips as two separate one-way tickets.

Don’t check luggage. This technique only works if you’re carrying on, because otherwise your luggage will be checked through to the final destination on your ticket. And because overhead bin space is often limited, you’ll want to get to the gate early and consider paying for priority boarding so that your bag isn’t checked at the last minute.

Hub airports dominated by one or two carriers usually work best for hidden-city ticketing. You’re likely to save money if your desired destination is a major hub airport like Atlanta or Chicago O’Hare, which often feature over-inflated prices and act as the connection point for many flights.

Airports that are more competitive, like New York and Miami, are good options for third-leg destinations. Because these airports feature a lot of airlines competing for passengers, you’re more likely to find competitive fares. So search for these options as your “phantom” leg that you will abandon.

Be prepared for a last-minute snafu. If there’s a flight cancellation, your airline could route you to the final destination on your ticket through a different flight or destination. That’s the risk you take with hidden-city ticketing.