![]() |
|
A nicer mod_rewrite? - 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: A nicer mod_rewrite? (/thread-1401.html) Pages:
1
2
|
A nicer mod_rewrite? - thegirlinthecafe - 2007-04-30 Hi all, I was wondering if it is at all possible to get even nicer URL's in Zenphoto, as I am still not too keen on the way zenphoto is rewriting the urls at the moment. The best thing for me would be to use the title of the image in the url. An example: In stead of I would love to have http://www.thegirlinthecafe.com/photo2/new-york/123-times-square (where 123 is the id of the image in the database, if at all needed) I have this working on my photoblog (which is running pixelpost): http://www.thegirlinthecafe.com/photoblog/160-london-marathon and it works like a charm, google seems to love url's like that. Has anybody tried this? Is this at all possible? Thanks in advance for any help, A nicer mod_rewrite? - trisweb - 2007-05-01 You're right, that's ideal for Google. I think it thinks they're more relevant, unlike names of php files. Then again, I get great hits on my galleries with the .php extension. Unfortunately it's not easily changed (at all) - the unique identifier to find the photo requested is the actual filename, and the only way to get that is from the URL, so it must contain the filename. That's just how ZP works, it's filesystem-based. The titles are rather stored in the database as metadata, which you can't use to get a photo and doesn't need to be unique. In future versions I'm planning on basing the framework on the database while keeping filesystem synced, instead of the other way around. That should allow more reference options in the URL. I'll make sure to keep that in mind in development..... if I ever have free time again after this startup gets off the ground.... :-( A nicer mod_rewrite? - thegirlinthecafe - 2007-05-01 Hi Tris Thanks for your answer, and I really appreciate your hard work. I am just too lazy to rename all my pictures so they have proper titles, that's why titles in my case would make more sense in the url than the filename. But it has to do for now I guess A nicer mod_rewrite? - iriome - 2008-02-03 Hello, Does Zenphoto now support nicer URLs ? It would be nice to have URLs like "/album/qName-of-the-photo" instead of "/abum/IMG4254.JPG". Without changing the way the framework is designed, maybe you can just add a field to rename the photo ? Or, better, automagically transform the title into a qualified name (space replaced by -, etc...), and add a checkbox under the title field like "Rename the file for 'qName-of-the-photo' ?". Thanks ! A nicer mod_rewrite? - sbillard - 2008-02-03 Why don't you just rename the images in FTP? Or, better still, start them off with the name you want. A nicer mod_rewrite? - DirkSohler - 2008-02-08 Spaces, capitalization, special characters and so on in file names in the web are evil A nicer mod_rewrite? - sbillard - 2008-02-09 But, what has that got to do with the renaming of the image. If you don't want these characters in the name, don't put them there. A nicer mod_rewrite? - DirkSohler - 2008-02-09 Well, if i create a blog entry in Wordpress “Süße Sahne (selbst gemacht)†(“sweet cream (selfmade)â€), the URL will be “example.com/suesse-sahne-selbst-gemacht†A nicer mod_rewrite? - sbillard - 2008-02-09 Maybe the i18n project will take this on. A nicer mod_rewrite? - jsumners - 2008-02-10 To the original topic: I've taken this request on, and will get it worked out when I can. I might not get it done until after my current semester, though. My senior project comes first. (Yay wavelets!) A nicer mod_rewrite? - acrylian - 2008-02-10 I see the problem with the spaces etc but for renaming the image to a proper title we have the admin backend. DirkSohler: But the difference to zenphoto is that wordpress is not file system based. sbillard: This is not really something that belongs to l18n, it's a general topic. Jsumners: No hurry, I have already sort of a function, that can do things like that, that needs a little refining. A nicer mod_rewrite? - DirkSohler - 2008-02-10 Jep, it’s not fs based, and that is one of the reasons, why i switched to zenphoto! A nicer mod_rewrite? - iriome - 2008-02-23 sbillard, I can actually rename each file with the right name before posting them on Zenphoto, but it is not the best solution. I see to problem : 1/ you have to set the title twice : first in the filename, second in the title field when you post the photo 2/ even if I rename a "IMG1234.JPG" into "my-first-day-in-Berlin.jpg" for instance, there is still this ".jpg" that has no reason to be in the URL (cf http://www.w3.org/Provider/Style/URI). I want to remove this extension because with an album photo, you don't just give access to a photo file, you give access to a whole photo+title+comments+category+tags resource, which is more than a simple file, and so can't have any extension. That's why I suggested : 1/ to have a checkbox in the form to add a photo that, if checked, generate a qualified name from the title (the way Wordpress does, cf DirkSohler comment), and rename the file this way. For instance, if I put "My first day in Berlin" as title, the file IMG1234.JPG I sent is renamed on the server as my-first-day-in-berlin.jpg 2/ find a way (maybe with Apache content negociation or mod_rewrite) to use the URL /my-first-day-in-berlin, without the ".jpg" This way, Zenphoto would have very nice URLs, without changing the whole design (i.e. zp would still be FS based, and not DB based as Wp or other script can be). It would be great, I can't find a great photo album manager with nice URL... Thanks again for your work ! A nicer mod_rewrite? - sbillard - 2008-02-23 iriome: There is an option to add a image suffix, so you could use, say "view" and your file would show as "my-first-day-in-Berlin.jpg/view" If you put a title in your EXIF/IPTC data, it will be used as the zp title. Omitting the suffix on the filename that is on the server will cause all sorts of problems for zenphoto. That's the key it uses, for instance, to recognize images vs other files. Nothing is needed in mod_rewrite to omit the suffix. The problem is how to determin what the suffix should be. No suffix: then it is an album request. JPEG, JPG, GIF, PNG? FLV, 3GP, MOV? It would not be too hard for you to modify a theme to omit the suffix. But then every request will go to your albums.php file. It could then decide what to do. BTW, I am wondering how much of a problem this really is. Why are you looking at the URL anyway, the images should be the attraction of your album. A nicer mod_rewrite? - sbillard - 2008-02-23 BTW, you do not have to do the rename twice. Just rename the image before the upload. ZP will use the image name (without the suffix) as the default title. A nicer mod_rewrite? - sbillard - 2008-02-23 Update: You can modify the function zp_load_request() so that it will treat the last name in the list as the image name if you wish. Just add the .jpg suffix to what rewrite_get_album_image() returns as the image filename. A nicer mod_rewrite? - iriome - 2008-02-24 I didn't know about EXIF/IPTC title, wich soft handle this ? (I use digikam but i haven't seen this). I will try to create a maintenable hack for my problem. Thanks A nicer mod_rewrite? - sbillard - 2008-02-25 Photoshop Bridge does a nice job of editing EXIF/IPTC data. I am sure there are other programs that do this as well. A nicer mod_rewrite? - steve.goodmedia - 2009-02-27 Is it possible to remove the .jpg extension from the end of a url by using .htaccess A nicer mod_rewrite? - acrylian - 2009-02-27 No http://www.zenphoto.org/2008/08/troubleshooting-zenphoto/#30 |