fixed has_alt_urls? and has_redirect_to_url? conditions.
!alt_urls(page_or_post).empty? && !alt_urls(page_or_post).nil? were redundant conditions whenever value of page_or_post.data['redirect_from'] == nil. In this case alt_urls = [nil]
!alt_urls(page_or_post).nil?  was redundant because final output of alt_urls is always an array

put some missing things