Guide: Using rewrites with Gallery2

 
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting
View previous topic :: View next topic  
Author Message
Lawrence
-


Joined: 16 Jan 2003
Posts: 207
Location: Brisbane, AU

PostPosted: Mon Oct 01, 2007 8:27 am    Post subject: Guide: Using rewrites with Gallery2 Reply with quote

I run Gallery2 on my server, and it's a nice piece of software. It has a strange rewrite system that doesn't translate well to Abyss.

Someone converted this weird system to one that works with lighttpd, and happily that rewrite is much more like the regular apache mod_rewrite rules that we need for Abyss.

You can find the lighttpd page here, but for convenience I've included a more Abyss-friendly list below.

The first line is the regexp, the second is the redirect-to path.
For every rule I turned off 'case sensitive', and the Next Action is always 'stop'. All other settings are left as default.

Code:
^/(.*)/Rewrite.txt$
 /$1/Works.txt

^/gallery2/v/(\?.+|\ .)?$
 /gallery2/main.php?g2_view=core.ShowItem

^/gallery2/admin[/?]*(.*)$
 /gallery2/main.php?g2_view=core.SiteAdmin&$1

^/gallery2/d/([0-9]+)-([0-9]+)/([^\/]+)(\?|\ )?(.*)$ =>

^/gallery/d/([0-9]+)-([0-9]+)/([^\/]+)(\?|\ )?(.*)$
 /gallery/main.php?g2_view=core.DownloadItem&g2_itemId=$1&g2_serialNumber=$2&$3

^/gallery/v/([^?]+)/slideshow.html
 /gallery/main.php?g2_view=slideshow.Slideshow&g2_path=$1

^/gallery/v/([^?]+)(\?|\ )?(.*)$
 /gallery/main.php?g2_view=core.ShowItem&g2_path=$1&$3

^/gallery/c/add/([0-9]+).html
 /gallery/main.php?g2_view=comment.AddComment&g2_itemId=$1

^/gallery/c/view/([0-9]+).html
 /gallery/main.php?g2_view=comment.ShowAllComments&g2_itemId=$1

^/gallery/p/(.+)
 /gallery/main.php?g2_controller=permalinks.Redirect&g2_filename=$1
Back to top View user's profile Send private message Visit poster's website ICQ Number
admin
Site Admin


Joined: 03 Mar 2002
Posts: 958

PostPosted: Tue Oct 02, 2007 12:37 am    Post subject: Re: Guide: Using rewrites with Gallery2 Reply with quote

Lawrence,

Thank you for taking the time to post and share that list of URL rewriting rules with our users' community.
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
lond
-


Joined: 25 Jan 2009
Posts: 2

PostPosted: Sun Jan 25, 2009 3:36 pm    Post subject: Reply with quote

Hi!

Can someone send me a screen dump or a cutout form the config file, so I can get the URL rewriting to work in Gallery2?

// Marcus
Back to top View user's profile Send private message
lond
-


Joined: 25 Jan 2009
Posts: 2

PostPosted: Sun Jan 25, 2009 7:50 pm    Post subject: Reply with quote

Hi!

When I did the URL_rewrite one by one I got it to work.

How should I setup the rules to get Gmap and WebDAV to work?

// Marcus
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group