You need to check if WordPress Address (URL) and Site Address (URL) are configured correctly. Go to > Settings > General / see image below:
Enter your URL with the port number: http://localhost:8888/csdev
This will solve WordPress unnecessary redirecting you.