this is an old post but I answer anyway, because it can help someone else.
First, you in fact asked how to make relative paths: but that's not a good thing, for a couple of reasons:
1 not good for search engines: that's because you end up with a resource that is not unique
2 not good for plugins: that's because the thing can generate compatibility problems
I found that its probably better (faster and doesn't require plugins) do a find&replace via SQL, since it's a really simple command:
update wp_posts set post_content = replace(post_content,'http://localhost:8888','new domain')
I had the problem that I develop sites locally.
Here's a 'for dummies' explanation of the command. With this command, you simply say:
1 go to table named wp_posts (the table where wordpress saves all kind of posts and pages)
2 take a look to the post_content column (the column that contains the post contents)
3 replace any string that is like 'http://localhost:8888' with 'new domain' (well, not 'new domain' literally, instead, your domain)
That's all. You can do this in phpMyAdmin: click on the sql tab and type in the sql.
It's quite hard to do it wrong, but anyway, always make a backup of the database first.
hope it helps.
P.s.
As said, the original question could be a sort of duplicate, but not exaclty, since it's about relative paths, not path substitution. This answer instead, can in fact answer the 'duplicated' question. But I posted it here to take the people who (as me some time ago) wants relative paths and don't know thei're not good, to the right fix of the problem.