![]() |
|
RewriteRule to remove "albums/" - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: RewriteRule to remove "albums/" (/thread-11846.html) |
RewriteRule to remove "albums/" - LondonLight.org - 2014-06-28 Hey! I'm almost done writing a new ZenPhoto theme tailored to showing HTML5 and Flash virtual panoramas. One last thing I need to get working is panorama hotspots. When I open a pano from the album-pano.php page everything works fine - the image-pano.php page is loaded, the title and description of the "image" are shown and the panorama plays in the . Javascript from Pano2VR targets the #container and puts the panorama there. The problem is that when a user clicks on the door hotspot to go to the next panorama, that is handled by the javascript from Pano2VR which then replaces the contents of #container with the new pano. That's no good, because the name and description of the pano on my page outside of #container remains from the previous one. I want to use hotspot urls relative to the current image (the whole tour resides in one album) so that I can then rename the album and parent albums without worrying about breaking links, otherwise if I use absolute URLs I'm in for a lot of work if I want to rename a parent album, I'd have to edit every pano's XML file which contains the hotspot URLs. I think I solved the problem, unfortunately when a user clicks on the door, instead of getting taken to Even though the URL in the web browser is When a user clicks on a hotspot, the browser URL shows Please help getting htaccess to remove "albums/" from the URL if it contains it. /zp/.htaccess htaccess file version 1.4.5;Rewrite rules are now handled by PHP codeSee the file "zenphoto-rewrite.txt" for the actual rulesThese rules redirect everything not directly accessing a file to the Zenphoto index.php script
RewriteEngine On RewriteBase /zp RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteRule ^.*/?$ index.php [L,QSA] ` RewriteRule to remove "albums/" - acrylian - 2014-06-28
What you are looking for is the You get that via RewriteRule to remove "albums/" - LondonLight.org - 2014-06-28 Here's a cleaner explanation (because now I understand the problem better): Folder structure: I use Pano2VR to display the pano in a div with id #container. The Pano2VR player is written in javascript, and uses XML files to store each panorama's configuration. The XML file must have an XML extension. pano.readConfigUrl("");
For reference: Clicking on any image thumbnail from my album-pano.php page loads the panorama in the image-pano.php page correctly. The problem are the hotspots. If I use RewriteRule to remove "albums/" - acrylian - 2014-06-28 You really don't need to use htaccess. That will have side effects, the actual rewrite handling is not done via that at all but internally.
You request the full image so that gets you the txt file on text objects correctly. If you wish to link hotspot to further panoramas based on text objects you need to link to the image page instead the item itself. I hope I understood the issue correctly. You probably have to use the object model directly as within your scripts the right context are not set for normal template functions. Of course since Zenphoto is file system based any renaming of albums or images will require changes afterwards. The names are also the base for the object model. I hope that helps for now. RewriteRule to remove "albums/" - LondonLight.org - 2014-06-28 Acrylian thank you for taking the time to read through this and answer I think I understand you, and I think you understood the issue correctly. Quote:If you wish to link hotspot to further panoramas based on text objects you need to link to the image page instead the item itself. I hope I understood the issue correctly. Knowing that if I set the hotspot URL to just RewriteRule to remove "albums/" - acrylian - 2014-06-28 I can only cite my post from above: Quote:What you are looking for is the image.php page url. No need for htaccess modifcation should be needed. You get that via getImageURL() if you are in image context, for example withon the next_image() loop. Example of that is in every standard themes' album.php page. Or via the object model $image->getLink() where $image is an image object naturally. Also take a look: RewriteRule to remove "albums/" - LondonLight.org - 2014-06-28 I read those pages several times already. I don't follow how any of that helps if I'm clicking on a link which gets handled by proprietary obfuscated javascript, not by ZenPhoto, and the link should be relative to nothing more than its containing album. The result of the click is this URL I got the hotspots working correctly using /zp/.htaccess RewriteRule to remove "albums/" - acrylian - 2014-06-29 Maybe I then did not understand the problem exactly.So you are talking about links within the txt- file then? Those are indeed outside of the "knowledge" of Zenphoto scope then. You can either use absolute or relative paths to achieve it probably. A proper site link example might have helped. But anyway whatever works for you :-) |