It can be done in the .htaccess file if you just want to add .html to the end of all urls.
rWatcher
Joined: 2005-09-06
Posts: 722
Posted: Sun, 2010-11-21 07:03
I believe there's an option in the application/config/config.php file for this...
If you edit line #62 to set url_suffix to .html, all the URLs gallery generates will end in .html (but the URL will still work without .html as well): $config["url_suffix"] = ".html";
Okay, I've spent about 3 hours on this; I'm ALMOST certain that the issue is the edit to the config file.
I noticed today that the "organize album" panel/window/function no longer worked properly. I began rolling back all the changes I've been making. I'm now 98% sure that if you make the change above (line #62 of the config file), "organize album" no longer functions.
I've been trying to figure out how to work around it. No luck.
The solution should be simple:
1) Check to see if the suffix has been defined
2) If so, remove the the suffix from the "organize album" url
but that's not working. (I also noticed that the framework already tries to do that.)
rWatcher
Joined: 2005-09-06
Posts: 722
Posted: Tue, 2010-11-23 05:19
That's weird. It looks like editing the config file to enable dummy .html urls somehow breaks the REST module, which the organize module uses when you click on the organize album link (so anything else that's REST dependent will also be broken). As the album and photo pages function properly regardless of if the dummy .html suffix is present in the URL, I'm not sure why the REST module would have an issue with it.
bharat
Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2010-11-23 06:03
Ah, yeah I tracked this down. So the problem is that we compare against generated absolute urls using url::abs_site and url::abs_current when we parse the REST urls. That code wasn't taking into account a url_suffix. I just submitted a change to fix that.
You'll probably need to add the following internal RewriteRule in the .htaccess before the RewriteCond statements that Gallery uses so that it's changed back to a format Gallery understands:
Posts: 7994
No way to do that currently without modifying the code. Might not be a hard modification to make, though.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git
Posts: 1857
It can be done in the .htaccess file if you just want to add .html to the end of all urls.
Posts: 722
I believe there's an option in the application/config/config.php file for this...
If you edit line #62 to set url_suffix to .html, all the URLs gallery generates will end in .html (but the URL will still work without .html as well):
$config["url_suffix"] = ".html";
Posts: 7994
Oh wow that is awesome -- I didn't even know about that Kohana feature!
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git
Posts: 1857
Okay, I've spent about 3 hours on this; I'm ALMOST certain that the issue is the edit to the config file.
I noticed today that the "organize album" panel/window/function no longer worked properly. I began rolling back all the changes I've been making. I'm now 98% sure that if you make the change above (line #62 of the config file), "organize album" no longer functions.
I've been trying to figure out how to work around it. No luck.
The solution should be simple:
1) Check to see if the suffix has been defined
2) If so, remove the the suffix from the "organize album" url
but that's not working. (I also noticed that the framework already tries to do that.)
Posts: 722
That's weird. It looks like editing the config file to enable dummy .html urls somehow breaks the REST module, which the organize module uses when you click on the organize album link (so anything else that's REST dependent will also be broken). As the album and photo pages function properly regardless of if the dummy .html suffix is present in the URL, I'm not sure why the REST module would have an issue with it.
Posts: 7994
Ah, yeah I tracked this down. So the problem is that we compare against generated absolute urls using url::abs_site and url::abs_current when we parse the REST urls. That code wasn't taking into account a url_suffix. I just submitted a change to fix that.
Ticket:
https://sourceforge.net/apps/trac/gallery/ticket/1500
Fixed in 3.0.x and master.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git
Posts: 1857
Thanks @rWatcher @bharat.
Posts: 51
problem in tag page if using .html .... how i can fix it ?
thanks,
Posts: 1857
@glodakan: What do you mean? What is the problem? What do you mean by "tag page"?
Posts: 51
photo by tag can't displaying bro..
http://pamer.in/tag/Travels.html
Posts: 241
You'll probably need to add the following internal RewriteRule in the .htaccess before the RewriteCond statements that Gallery uses so that it's changed back to a format Gallery understands:
I guess it doesn't automatically take account for the URL suffix in the case of tags.
Thanks,
Mark H.
Using Gallery 3.0.1 - gallery.markheadrick.com
Posts: 51
@MarkRH : cannot work for me..