Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Nice urls with Apache's mod_rewrite  (Read 3656 times)

0 Members and 1 Guest are viewing this topic.

JensBman

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Nice urls with Apache's mod_rewrite
« on: December 27, 2004, 08:29:31 pm »

Hi!

I saw one or two request of this but there were from like 2002-2003 so I thought its time to take it up again. The only problem I have with cpg right now is the url's. Its much nicer to tell a friend to go to www.backeman.se/gallery/miniscour04 than www.backeman.se/gallery/thumbnails.php?album=10, and url that they will never remember.

Im not sure how big trouble it is to implement it but I have seen a few very small gallerys have it so... Well, I just hope you will implement it soon.

Keep up the good work!!

Best regards,
Jenz
« Last Edit: December 28, 2004, 05:44:13 am by GauGau »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Nice urls with Apache's mod_rewrite
« Reply #1 on: December 27, 2004, 08:38:04 pm »

I think the reason we can't do this is that not everyone has mod_rewrite access. It's nice to use such a URL but impractical when dealing with database-driven items at the scale that cpg does it. Who verbally tells people URLs that often anyway. People usually tell URLs via email/IMs.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Nice urls with Apache's mod_rewrite
« Reply #2 on: December 28, 2004, 05:43:55 am »

TranzNDance is right (as always): putting this into coppermine's core code would result in coppermine not working for users on IIS and webhosting without mod_rewrite. I can see litlle point in narrowing down the number of users coppermine can have for the sake of just a nice-to-have feature. However, there are postings on mod_rewrite with coppermine on the mods board.
In other words: your request is turned down; you're recommended to use the mod instead.

Joachim
Logged

JensBman

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Nice urls with Apache's mod_rewrite
« Reply #3 on: December 28, 2004, 01:25:48 pm »

Ahh, found it. Thanks!

Well, I agree with one fellow that said something about autodetection and so on but I can understand the reasons why you don't want to implement it.

I'll try the mod. Thanks for your help!

/Jenz
Logged

partypics

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 24
Re: Nice urls with Apache's mod_rewrite
« Reply #4 on: January 09, 2005, 12:21:03 am »

First of all I would like to thank the CPG developers community for such a great software!
I have read this thread http://forum.coppermine-gallery.net/index.php?topic=69.0 and done the modifications posted by Oasis to make nice url's to users galleries - and it worked fine in CPG 1.3.2
Just wanted to add my little improvement:
in original code a url like www.somesite.com/someuser
would work fine, but a url like www.somesite.com/someuser/ (with an ending "/") would fail.
To correct this you can add a line in .htaccess, redirecting www.somesite.com/someuser/ to www.somesite.com/someuser before other lines.
I used this regexp and it worked fine:
Code: [Select]
RedirectMatch ^/([a-z0-9&_=]+)/$ /$1
The second step, I think, is to make url's look like this:
www.somesite.com/someuser/album_name to point to a specific album. Users would love it.
I thought, that a redirect like
Code: [Select]
RedirectMatch ^/([a-z0-9&_=]+)/([a-z0-9&_=]+)$ /thumbnails.php?album=$2would work, but it does not in Apache 1.* because "?" is translated into "%3f" and you can't pass arguments to a redirected script. It seems to be an Apache bug, which have been fixed in Apache 2 (not sure about it though, read somewhere else).
RewriteRule works with this regexp, but not entirely suitable:
you are actually on www.somesite.com/someuser/thumbnails.php, not www.somesite.com/thumbnails.php and links dont work, css and images don't load correctly, etc.

Anyone has done it before? Any ideas would be very appreciated. Thanks.

 

PS
Sorry, it looks like I chose the wrong place for my post, please move it to appropriate topic  ::)
« Last Edit: January 09, 2005, 12:33:52 am by partypics »
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.