A novel two-way ranging approach was introduced into the Wireless Fidelity (WiFi) standard, and its ranging accuracy reached one meter in a low multipath environment. However, in harsh environments due to multipath or non-line of sight (NLOS), the range measurement based on the WiFi round trip time (RTT) usually has low accuracy and cannot maintain the one-meter accuracy. Thus, this paper proposes an indoor positioning method based on Gaussian process regression (GPR) for harsh environments. There are two stages in the proposed method: construction of a positioning model and location estimation. In the model construction stage, based on known positions of access points (APs), we can determine the position coordinates of some ground points and the reference distances between them and the APs, and the offline ranging difference fingerprints can be generated by the reference distances, which means that there is no need to collect data. Gaussian process regression (GPR) utilizes offline ranging difference fingerprints based on the reference distance to establish a positioning model, and the particle swarm optimization (PSO) algorithm is employed to estimate the GPR hyperparameters. In the location estimation stage, the gathered actual range measurements generate the online ranging difference fingerprint, which is the input data of the positioning model. The output of the model is the estimated position of the smartphone. Experimental results show that the mean errors (MEs) of the proposed method and Least Squares (LS) algorithm are 1.097 and 3.484 meters, respectively, in a harsh environment, and the positioning accuracy of the proposed method improved by 68.5% compared with the LS algorithm.