Best way to hook a custom url?

The approach is pretty much sound, this is how these things work in WordPress.

You might want to use add_rewrite_enpoint() for implementation though, since it compresses multiple steps into on integrated call and fits many use cases well.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)