user's album by url http://site.com/gallery/username - Page 2 user's album by url http://site.com/gallery/username - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

user's album by url http://site.com/gallery/username

Started by newbie, April 05, 2005, 07:12:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


andrewshu329

Thanks for helping me out everyone, I'm still fairly new to all this.

I forgot to change things around in config after upgrading so I just did that now.

In config, I typed for the fields
URL of your coppermine gallery folder: http://www.sasphotos.net/gallery/
URL of your home page: /gallery/index1.php

The link
http://www.sasphotos.net/gallery/useralb.php
works now.

However, typing in a link such as
http://www.sasphotos.net/gallery/andrew
still doesn't.

So my useralbs.php file shouldnt have any problems, my .htaccess file is ok, mod_rewrite is already enabled, where else could there be a problem?

I'm not sure if I should ask two questions in the same thread, but..does anyone know why http://www.sasphotos.net/gallery/ doesn't forward to the index1.php file (my home page) or even the default index.php file?

Thanks everyone!

PS: Thanks for the heads up nibbler.
CPG 1.4.2
Apache 2.0.54
PHP 5.0.5
MySql 4.1

Nibbler

OK, do a test. Temporarily change the line in your .htaccess to

RewriteRule ^.*$ http://www.google.com

If nothing happens then, it means your .htaccess file is not even being read. If you do get directed with that code, then the file just needs tweaking.

andrewshu329

Hi nibbler,
I just saved the changes and nothing happens.
www.sasphotos.net

This is what's in my .htaccess file:
RewriteEngine On
RewriteRule ^.*$ http://www.google.com


Thanks,
Andrew
CPG 1.4.2
Apache 2.0.54
PHP 5.0.5
MySql 4.1

Nibbler

Right, so it's matter of server setup in that case.

Scenemusic

well

i added the code and the .htaccess

I have a gallery under the username Christophe.

Coppermine is in a directory called photobook, the alias set is http://www.linkedscene.com/photo/

if i use

RewriteRule ^.*$ http://www.google.com

it works fine and i go immediatly to google.

if i use

RewriteRule ^photo/([^\./]+)$ photo/useralb.php?user=$1

it doesn't work (The requested URL /photo/christophe/ was not found on this server).

any idea ?  ???

AWJunkies

#26
QuoteI am getting same problems as Scenicmusic. I know it is an issue with the .htaccess file and the redirect. I can manuely put in:
http://www.allwheelphotos.com/cpg143/useralb.php?user=AWJunkies  and it will go to my gallery (so the php file is correct and functional). SO why does it not work when I put in: http://www.allwheelphotos.com/cpg143/AWJunkies  ?? I have tried putting the .htaccess file in root directory of coppermine install which would be (public_html/cpg143/) and I have tried putting it in the (public_html) niether are working but your test with the google .htaccess file works in both of these sections.

Stand alone 1.4.3 Stable

----------------------------------------------------------------------------------------------
I got it to work! Dam awesome mod! Thanks guys. Put the .htaccess file with the following code:

RewriteEngine On
RewriteRule ^([^\./]+)$ useralb.php?user=$1

under your coppermine root directory (public_html/gallery) or (public_html/photos) or in my case (public_html/cpg143)
Hope this helps some of the people who are having issues or would be.

I also have a LOT of mods to share with the community and I will get to it in due time. 

--------------------------------------------------------------------------------------------------------------------------------------
NOW to go even further I changed the .htaccess file too:

RewriteEngine On
RewriteRule ^([^\./]+)$ cpg143/useralb.php?user=$1

and put it into my root directory on server being public_html. This causes http://www.allwheelphotos.com/AWJunkies link to the album for that user rather then having them put in copermine directory. MUCH easier and better for user and looks better. Hope this helps some people as well :)

andrewshu329

Hi everyone,
I decided to stop tinkering with .htaccess files and just used the apache config file.
Anyways, now it works as advertised.

However, I was wondering if i can make it so that after typing www.mysite.com/username, the url displayed in the box would remain www.mysite.com/username, instead of immediately changing to something like www.mysite.com/gallery/index.php?cat=10037. Also, so that browsing to the user Gallery through the album list view and such would change the displayed url automatically to www.mysite.com/username, and would remain so as long as the viewer is in that user's gallery.

Thanks.
Andrew
CPG 1.4.2
Apache 2.0.54
PHP 5.0.5
MySql 4.1

dEnA

/useralb.php?user=USERNAME
works for me, but when I try putting the .htaccess file to my server it immediately comes an "500 Internal server error" to the whole site.
No matter whats in that htaccess and where it is. Please help me
thanks
"dEnA"

dEnA

Ok so that solved out to be because of I dont have mod_rewrite and it cant be enabled cause of security issues...
But why doesnt it work to put the php code in the gallerys index.php.
That would make the url to the usergallery more easy

Joachim Müller

if you don't have mod_rewrite, then there can't be a feature like that, no workaround possible.

dEnA

Yes, but i meant the useralb.php's code.
Why cant it be put in the gallerys index.
That would make the url to ../gallery?user=USERNAME instead of ../gallery/useralb.php?user=USERNAME

Joachim Müller

no difference, the URL will not be any more search engine friendly either way round. If you need that feature, code it. Won't be helpful, as it's not easier to memorize nor more attractive for search engine spiders. Anyway, your question doesn't belong to this thread, please stop replying to it.

dj_wpa

Has anyone tried this using IIS on a Windows 2000 server?

Tranz

This mod requires using .htaccess, which is specific to apache. You would need to search around to see how to use mod rewrite in IIS.

Dr Preacox

Okay well here I go making things hard for myself,

Since my gallery doesn't use private user albums but a Huge public Gallery I needed to modd my code a bit so I changed the following and encountered some problems, just wondering if you could please help.

Useralb.php, now what I have edited in here is I have changed index.php?cat= to profile.php?uid= now the first problem I encounter is, as well as getting the userid I also get 100 before it, which I think is the + FIRST_USER_CAT part of the code, but I cant seem to remove it and get it too work. so is this possible?
<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');

header('Location: ' rtrim($CONFIG['ecards_more_pic_target'], '/') .'/profile.php?uid='.(get_userid($_GET['user']) + FIRST_USER_CAT));

?>


And my .Htaccess

RewriteEngine On
RewriteRule ^gallery/([^\./]+)$ gallery/useralb.php?user=$1



also I was wondering if in .htaccess I could make the Url as http://username.dc-6.com and just have it link to http://www.dc-6.com/gallery/profile.php?userid=USERID

if someone could help me with this I will roll it into a short mod and post it for others,
My Mods:
Making Memberlist Public - VIEW
Different Way of Displaying Categories - VIEW
Coming Soon - Automated Sub Domains -MOD

bitcloud

Regarding andrewshu329's idea:
Having "gallery.com/username" staying in the location bar instead of redirecting immediately to "gallery.com/profile.php?uid=1"

I have heard of a "blind redirect"
I don't how anything about this mythical beast, but if anyone's ever set up a blind redirect to keep the location bar displaying "/username", that would be the next logical step for this mod...

anyone know if this is possible?

bitcloud

Edit: This mod is actually a blind redirect as it is - only it doesn't work that way.

Example:
RewriteRule ^gallery$ http://www.gallery.com/thumbnails.php?album=3
works fine and you'll be left at gallery.com/gallery

but this mod rewrite rules don't leave you at the username, but instead leave you at the dynamic profile.php URL...

any clues on getting this mod to work the same way as a standard blind redirect?

Nibbler


bitcloud

thanks a heap nibbler... You're always exceptionally helpful - it doesn't go unappreciated...
If I could mod you, you'd have more karma than big mac has calories...

I'll look into it and post my results here