.html Url

asianventure
asianventure's picture

Joined: 2010-10-23
Posts: 3
Posted: Mon, 2010-11-15 02:08

Hi,
How can I set up album and photos with .html in url

Thanks

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2010-11-19 20:06

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

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2010-11-20 20:32

It can be done in the .htaccess file if you just want to add .html to the end of all urls.

 
rWatcher
rWatcher's picture

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";

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2010-11-21 07:31

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

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Mon, 2010-11-22 21:04

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
rWatcher's picture

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
bharat's picture

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.

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

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Tue, 2010-11-23 15:52

Thanks @rWatcher @bharat.

 
glodakan
glodakan's picture

Joined: 2010-06-13
Posts: 51
Posted: Mon, 2011-02-07 15:06

problem in tag page if using .html .... how i can fix it ?
thanks,

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Mon, 2011-02-07 15:13

@glodakan: What do you mean? What is the problem? What do you mean by "tag page"?

 
glodakan
glodakan's picture

Joined: 2010-06-13
Posts: 51
Posted: Mon, 2011-02-07 16:00
tempg wrote:
@glodakan: What do you mean? What is the problem? What do you mean by "tag page"?

photo by tag can't displaying bro..
http://pamer.in/tag/Travels.html

 
MarkRH

Joined: 2007-05-25
Posts: 241
Posted: Mon, 2011-02-07 21:37

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:

<IfModule mod_rewrite.c>
   Options +FollowSymLinks
   RewriteEngine On
   RewriteBase /

   RewriteRule ^tag/(.*)\.html$ tag/$1 [NC,L]

   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
   RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
   RewriteRule ^index.php/(.*) $1 [QSA,R,L]
</IfModule>

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

 
glodakan
glodakan's picture

Joined: 2010-06-13
Posts: 51
Posted: Tue, 2011-02-08 08:29

@MarkRH : cannot work for me..