What is the best practice for defining a link on an image that redirects to a detail page with a specific ID?

When defining a link on an image that redirects to a detail page with a specific ID, the best practice is to use a query parameter in the URL to pass the ID to the detail page. This way, the detail page can retrieve the ID from the URL and display the corresponding content.

```php
<!-- HTML code for the image link -->
<a href="detail_page.php?id=123">
    <img src="image.jpg" alt="Image">
</a>
```

In the above code snippet, when the image is clicked, the user will be redirected to "detail_page.php" with the ID parameter set to 123. The detail page can then retrieve the ID using `$_GET['id']` and display the relevant content.