By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,395 Members | 2,513 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,395 IT Pros & Developers. It's quick & easy.

Htaccess and mysql photo album.

P: n/a
Hi there,

I've posted the following question elsewhere,
but got no response, and there seems to be no
special htaccess-group, so i took the liberty
to post it here. Hope y'all dont mind.

I have a site with a photo album on it.
Albums are stored in a MySQL db.
I use a site with a standard layout, with
an iframe in it, where the content is presented.

To the visitor albums appear to have the
following url:
site.com/photos/album_id/album_name/page_no
The last three parts are variable,
and it's translated to
site.php?album=album_id&page=page_no

That's the url of the main layout. The page
in the iframe has the same, except then index.html
behind it. (site.com/photos/album_id/album_name/page_no/index.html)
Hope it's still clear.

Because the album name is variable i use the following
in the htaccess file:
RewriteRule ^photos/([0-9]+)/(.*)/([0-9]+)(/)?$
site\.php\?album=$1&page=$3

BUT!! because of the '(.*)' part, it keeps looping when i call
the iframe's url because photos/5/bla AND photos/5/bla/index.html 'are
both (.*)'.
Does anyone know how to prevent this? Does it make a difference if i
put
the *.index.html rule before the other in the htaccess?

Sounds rather complicated i guess, but i don't really know how to
explain it different.

Thanks in advance!

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Tue, 21 Jun 2005 02:09:28 -0700, frizzle wrote:
Hi there,

I've posted the following question elsewhere, but got no response, and
there seems to be no special htaccess-group, so i took the liberty to post
it here. Hope y'all dont mind.

I have a site with a photo album on it. Albums are stored in a MySQL db.
I use a site with a standard layout, with an iframe in it, where the
content is presented.

To the visitor albums appear to have the following url:
site.com/photos/album_id/album_name/page_no The last three parts are
variable,
and it's translated to
site.php?album=album_id&page=page_no

That's the url of the main layout. The page in the iframe has the same,
except then index.html behind it.
(site.com/photos/album_id/album_name/page_no/index.html) Hope it's still
clear.

Because the album name is variable i use the following in the htaccess
file:
RewriteRule ^photos/([0-9]+)/(.*)/([0-9]+)(/)?$
site\.php\?album=$1&page=$3

BUT!! because of the '(.*)' part, it keeps looping when i call the
iframe's url because photos/5/bla AND photos/5/bla/index.html 'are both
(.*)'.
Does anyone know how to prevent this? Does it make a difference if i put
the *.index.html rule before the other in the htaccess?

Sounds rather complicated i guess, but i don't really know how to explain
it different.

Thanks in advance!


RewriteRule ^photos/([0-9]+)/(.[^/])/([0-9]+)(/)?$

or similar any use?
Jul 17 '05 #2

P: n/a
I'm sorry, i don't quite understand what you mean ...
And what does '(.[^/])' do?

Thanks!

Jul 17 '05 #3

P: n/a
*** frizzle wrote/escribió (23 Jun 2005 08:20:27 -0700):
I'm sorry, i don't quite understand what you mean ...
And what does '(.[^/])' do?


One character (any) plus one character (any except /).

--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.