check valid extension only if it is file
choose layout for blog and blogs