Can I use an absolute path as a backup in case the relative path fails to load?

For example if a relative paths fails to load is there a way I can code it so there will be an absolute path as a backup in case the first path won’t work?