I'm converting an existing website to a WordPress theme. One of the pages is a gallery that uses JS history.pushState
to create unique URLs for loading certain images.
E.g. page URL (non WP website): http://www.good-deeds-day.org/gallery/
URL for a certain image: http://www.good-deeds-day.org/gallery/img-35
I would like to preserve this functionality in WordPress. However, when loading the URL for a certain image, WordPress considers it as a different page and displays a 404 error.
Is there a way to configure WordPress or .htaccess
so that when such image URLs are loaded it will keep the URL and load the gallery page, thus displaying the relevant image in the gallery page?