Phishing is a widespread and dangerous form of cybercrime where attackers deceive users into disclosing sensitive information through fraudulent websites designed to mimic legitimate ones. This study explores the application of the Random Forest (RF) classification algorithm, optimized with Particle Swarm Optimization (PSO), for the detection of phishing websites using URL-based features. The research evaluates the impact of different data splitting ratios (80:20, 70:30, and 60:40) on the model's performance. The highest accuracy of 97.15% was achieved with an 80:20 split. These findings demonstrate that optimizing RF with PSO can significantly enhance phishing detection capabilities, offering a promising advancement for machine learning-based cybersecurity solutions.