Title: URL customizing
Last modified: April 13, 2020

---

# URL customizing

 *  Resolved [Obje](https://wordpress.org/support/users/harrow/)
 * (@harrow)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/url-customizing/)
 * Hi Arno,
 * First of all thank you for your awesome plugin. I was previously using the native
   Photoswipe with ACF plugin on my website in order to create a tailor-made gallery
   but I discovered your plugin and you made my life easier !
 * I was wondering if you have an idea to customize the urls generated by Photoswipe
   when triggering the plugin with the data of the current picture like so :
 * [https://www.website/page/theansweris42](https://www.website/page/theansweris42)
   
   instead of [https://www.website/page/#&gid=1&pid=12](https://www.website/page/#&gid=1&pid=12)
 * It’s not directly related to you plugin but as you may have went deep into Dimitry
   Semenov work, maybe you have an idea?
 * Thanks again,
    J

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/url-customizing/#post-12667679)
 * It’s not possible to change the URLs without braking the correct function of 
   PhotoSwipe. The URL is used for a single image. You can use that URL to open 
   the image using the lightbox, nothing else. Just replacing the URL in the URL
   bar with something else which does not represent the currently displayed image
   but opens a completely different page makes no sense at all.
 * The URLs are generated inside PhotoSwipe when an image is displayed in the lightbox.`
   gid` and `pid` are the ID of the image group and the image itself which is currently
   displayed. The frontend script also parses the URL to get the parameters from`
   gid` and `pid` so it can tell PhotoSwipe to open the lightbox using this specific
   image.
 * It may be possible to use “/page/theansweris42” instead of “/page/#&gid=1&pid
   =12” in the URL when opening an image (as long as the browser supports `history.
   pushState()` or `history.replaceState()` and this is not blocked for security
   reasons), this could be achieved by modifying PhotoSwipe to accept an URL parameter
   for each image in the collection to be used.
 * However – the real problem starts when someone wants to open such an URL. What
   should happen, if someone opens “/page/theansweris42″? In this case the URL /”
   page/theansweris42” has to be recognized by the frontend script as instruction
   to initialize and open a PhotoSwipe lightbox. So this means, you also need some
   kind of mapping on the server, that “/page/theansweris42” is not just some page,
   but refers to a single image inside another page which has to be used instead.
 * So – the whole thing would involve a lot of technical challenge and I don’t see
   the point what you want to achieve with this. The whole idea of the URL parameters
   is, that they start with “#”, so the browser will still load the page where the
   image is located and then the frontend script detects, that an image should be
   opened on this page.
 * For another project I did modify the URL pattern to be “#bild-” followed by the
   number:
 * [https://fahrradzukunft.de/29/wider-den-konsum/#bild-2](https://fahrradzukunft.de/29/wider-den-konsum/#bild-2)
    -  This reply was modified 6 years, 1 month ago by [Arno Welzel](https://wordpress.org/support/users/awelzel/).
      Reason: Typo
 *  Thread Starter [Obje](https://wordpress.org/support/users/harrow/)
 * (@harrow)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/url-customizing/#post-12670440)
 * Hi Arno,
 * Thanks for your quick and complete answer and it seems challenging to get it 
   done.
 * > So – the whole thing would involve a lot of technical challenge and I don’t
   > see the point what you want to achieve with this.
 * My concern was to create simple url to share a photo (website.com/page/theansweris42
   seems more relevant than website.com/page/#&gid=1&pid=12 to illustrate _H2G2_).
   I guess it could be better for SEO also, no?
 * Thank you.
 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/url-customizing/#post-12670738)
 * These URL will not be seen by search engines at all, since they only get generated
   for the user when opening the lightbox – so users can set a bookmark for specific
   image if they want to. So there is no need to “optimize” these URLs anyway.
 *  Thread Starter [Obje](https://wordpress.org/support/users/harrow/)
 * (@harrow)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/url-customizing/#post-12670754)
 * Ok I see. Thank you for this information.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘URL customizing’ is closed to new replies.

 * ![](https://ps.w.org/lightbox-photoswipe/assets/icon-256x256.png?rev=2906302)
 * [Lightbox with PhotoSwipe](https://wordpress.org/plugins/lightbox-photoswipe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lightbox-photoswipe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lightbox-photoswipe/)
 * [Active Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lightbox-photoswipe/reviews/)

## Tags

 * [URL rewriting](https://wordpress.org/support/topic-tag/url-rewriting/)

 * 4 replies
 * 2 participants
 * Last reply from: [Obje](https://wordpress.org/support/users/harrow/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/url-customizing/#post-12670754)
 * Status: resolved