This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Helicon Jet (Forum Locked Forum Locked)
 Helicon Tech : Helicon Jet
Subject Topic: Gallery2 rewrite support (Topic Closed Topic Closed)
Author
Message |
GrZeCh
Newbie


Joined: 27 March 2009
Posts: 18
Posted: 17 June 2009 at 3:37pm  

Hello,

does someone tried to use Helicon Ape's mod_rewrite with Gallery2 script?

This is what is generated from Gallery2:

# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    #RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   -   [L]

    RewriteCond %{THE_REQUEST} /admin/(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=core.SiteAdmin   [QSA,L]
    RewriteCond %{THE_REQUEST} /d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_path=%1   [QSA,L]
</IfModule>

# END Url Rewrite section
 
and it does not work :/ (there is no error. only info that page can't be found)

Any ideas?

Thanks
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 18 June 2009 at 2:38am  

Please specify what version of Windows you use. Have you tested mod_rewrite operation? Does any other rules work for you?
Also please enable logging and proivide error and rewrite log records for the specific request.

__________________
Regards,
Anton
Back to Top
 
GrZeCh
Newbie


Joined: 27 March 2009
Posts: 18
Posted: 18 June 2009 at 3:18am  

Windows version: Windows 2008 x64 (App Pools are running in 32bit and they are in integrated pipeline mode).

All rules does not work. For all of them I'm getting:

HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

There are no info regarding this in rewrite.log and error.log (loglevel for errors is debug and for rewrite is 9)

Helicon Ape is working for sure because when I use this:

# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)

<IfModule mod_rewrite.c>
    RewriteEngine On

    # The path to your Gallery (in this case example.com/gallery2/)
    RewriteBase /

    RewriteRule ^admin /main.php?g2_view=core.SiteAdmin   [QSA,L]
</IfModule>
# END Url Rewrite section

then this rule is working

EDIT: I'm using Ape version 0019.


Edited by GrZeCh - 18 June 2009 at 3:19am
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 18 June 2009 at 4:35am  

Please enable logging and provide error and rewrite log records for the specific non-working request.

__________________
Regards,
Anton
Back to Top
 
GrZeCh
Newbie


Joined: 27 March 2009
Posts: 18
Posted: 18 June 2009 at 4:42am  

Like I wrote I have logging enabled:

"There are no info regarding this in rewrite.log and error.log (loglevel for errors is debug and for rewrite is 9)"
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 19 June 2009 at 4:21am  

We've managed to figure out that Gallery2 doesn't work with mod_rewrite. Under IIS it does work with ISAPI_Rewrite2, so we advise you to use
this product.

__________________
Regards,
Anton
Back to Top
 
GrZeCh
Newbie


Joined: 27 March 2009
Posts: 18
Posted: 19 June 2009 at 4:30am  

Hello,
what do you mean by saying that Gallery2 doesn't work with mod_rewrite?

On their website with requirements:

http://codex.gallery2.org/Gallery2:Installation_Requirements#mod_rewrite

mod_rewrite is mentioned as a optional item.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 19 June 2009 at 7:45am  

Sorry, I was not clear enough.
The issue is that Gallery2 may be automatically configured either for ISAPI_Rewrite2 on IIS or mo_rewrite on Apache.
BUT,
it has no idea that mod_rewrite for IIS exists, so it can not configure itself to work with it.

__________________
Regards,
Anton
Back to Top
 
GrZeCh
Newbie


Joined: 27 March 2009
Posts: 18
Posted: 19 June 2009 at 8:00am  

yes it can :) I've successfully enabled URL Rewrite in Gallery2:

in "URL Rewrite Administration" section -> "Test" I'm getting:

 Test the Rewrite Parser Configuration
IIS ISAPI_Rewrite Support Success

Testing if the server supports IIS ISAPI_Rewrite.
   
The current status may not be accurate, you have forced the test to pass.

ISAPI_Rewrite httpd.ini file Success

Testing if Gallery can write to the httpd.ini file.


Gallery2 is generating httpd.ini file which contains mod_rewrite rules and renaming it to .htaccess produces 500 error. If you want I can provide you access to test website and FTP.
Back to Top
 
GrZeCh
Newbie


Joined: 27 March 2009
Posts: 18
Posted: 21 June 2009 at 5:24am  

One more thing. I have no idea why I wrote this topic inside Jet category. Can you move it to Ape section?
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 22 June 2009 at 4:03am  

We've managed to make it working, though it's not the obvious way.
In URL Rewrite module options choose config for ISAPI_Rewrite, point to the fake httpd.ini (which should have Write permissions), then skip
the rewriting test (Rewrite.txt -> Works.txt).

In URL Rewrite Administration we chose the following options:

Add Comment
View Comments
Keyword Album
Rating Album
Show Item
Download Item
Site Admin

The rules in generated httpd.ini were then manually converted to Helicon Ape mod_rewrite syntax and put into httpd.conf
(our testing host was 2008stdr and the application was in /gallery2/). We've got the following config working:

RewriteRule /gallery2/modules/rewrite/data/isapi_rewrite/Rewrite.txt /gallery2/modules/rewrite/data/isapi_rewrite/Works.txt

RewriteCond %{HTTP:Host} 2008stdr
RewriteCond %{REQUEST_URI} /gallery2/admin/(?:\?.*)?
RewriteRule ([^?]*) /gallery2/main.php?g2_view=core.SiteAdmin   [L,QSA]

RewriteCond %{HTTP:Host} 2008stdr
RewriteCond %{REQUEST_URI} /gallery2/d/([0-9]+)-([0-9]+)/([^/?]+)
RewriteRule ([^?]*) /gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [L,QSA]

RewriteCond %{HTTP:Host} 2008stdr
RewriteCond %{REQUEST_URI} /gallery2/v/([^?]+)/slideshow\.html
RewriteRule ([^?]*) /gallery2/main.php?g2_view=slideshow.Slideshow&g2_path=%1   [L,QSA]

RewriteCond %{HTTP:Host} 2008stdr
RewriteCond %{REQUEST_URI} /gallery2/c/view/([0-9]+)\.html
RewriteRule ([^?]*) /gallery2/main.php?g2_view=comment.ShowAllComments&g2_itemId=%1   [L,QSA]

RewriteCond %{HTTP:Host} 2008stdr
RewriteCond %{REQUEST_URI} /gallery2/c/add/([0-9]+)\.html
RewriteRule ([^?]*) /gallery2/main.php?g2_view=comment.AddComment&g2_itemId=%1   [L,QSA]

RewriteCond %{HTTP:Host} 2008stdr
RewriteCond %{REQUEST_URI} /gallery2/rating/([^?/]+)
RewriteRule ([^?]*) /gallery2/main.php?g2_view=rating.RatingAlbum&g2_limit=%1   [L,QSA]

RewriteCond %{HTTP:Host} 2008stdr
RewriteCond %{REQUEST_URI} /gallery2/key/([^?/]+)
RewriteRule ([^?]*) /gallery2/main.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=%1   [L,QSA]

RewriteCond %{HTTP:Host} 2008stdr
RewriteCond %{REQUEST_URI} /gallery2/v/([^?]+)
RewriteRule ([^?]*) /gallery2/main.php?g2_path=%1   [L,QSA]

__________________
Regards,
Anton
Back to Top
 
GrZeCh
Newbie


Joined: 27 March 2009
Posts: 18
Posted: 22 June 2009 at 4:36am  

I've managed to make it shorter and without need to provide host (gallery2 is installed in /). I had to add "RewriteEngine On" to make rewrite engine working:

RewriteEngine On

RewriteCond %{REQUEST_URI} /admin/(?:\?.*)?
RewriteRule ([^?]*) /main.php?g2_view=core.SiteAdmin   [L,QSA]

RewriteCond %{REQUEST_URI} /d/([0-9]+)-([0-9]+)/([^/?]+)
RewriteRule ([^?]*) /main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [L,QSA]

RewriteCond %{REQUEST_URI} /v/([^?]+)/slideshow\.html
RewriteRule ([^?]*) /main.php?g2_view=slideshow.Slideshow&g2_path=%1   [L,QSA]

RewriteCond %{REQUEST_URI} /c/view/([0-9]+)\.html
RewriteRule ([^?]*) /main.php?g2_view=comment.ShowAllComments&g2_itemId=%1   [L,QSA]

RewriteCond %{REQUEST_URI} /c/add/([0-9]+)\.html
RewriteRule ([^?]*) /main.php?g2_view=comment.AddComment&g2_itemId=%1   [L,QSA]

RewriteCond %{REQUEST_URI} /rating/([^?/]+)
RewriteRule ([^?]*) /main.php?g2_view=rating.RatingAlbum&g2_limit=%1   [L,QSA]

RewriteCond %{REQUEST_URI} /key/([^?/]+)
RewriteRule ([^?]*) /main.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=%1   [L,QSA]

RewriteCond %{REQUEST_URI} /v/([^?]+)
RewriteRule ([^?]*) /main.php?g2_path=%1   [L,QSA]
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum