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: Redirects from old CPG galleries to new pages  (Read 4143 times)

0 Members and 1 Guest are viewing this topic.

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Redirects from old CPG galleries to new pages
« on: January 21, 2023, 04:07:02 am »

Apologies . I posted this in the older 1.5 support .. it might be better here.

I'm switching to a new server, and no longer using cpg, and having trouble getting redirects from the old cpg galleries and images to work.

For albums and categories that I will not redirect, just are gone and no longer exist, I wrote the 410 rule as

Code: [Select]
RewriteRule ^stock/thumbnails\.php\?album=62$ - [R=410, L]

That breaks the new site and creates a 500 error

For old cpg albums that I want to redirect to a new url, I wrote

Code: [Select]
RewriteRule ^stock/thumbnails\.php\?album=36$ https://www.domain.com/gallery/appalachian-trail-photos/ [R=301,L]

But it does nothing. THe urls from cpg show as 404 pages. I also tried it as

Code: [Select]
Redirect 301 /stock/index.php?cat=2 https://www.domain.com/gallery/outdoor-recreation-photos/

which also does nothing.

I also want to redirect any image display pages to the root gallery of their relative album. So an image from a particular cpg album would go to the gallery page for that on the new site. I wrote

Code: [Select]
RewriteRule ^stock/displayimage\.php\?album=30&.*$ https://www.domain.com/gallery/canadian-wildlife-photos/ [R=301,L]
RewriteRule ^stock/displayimage\.php\?album=32&.*$ - [R=410,L]

to send any image from album 30 to the CA wildlife photos album and any image from album 32 is gone.

None of these last work but I can't see what's wrong with them?

Any help would be superduper appreciated, thanks.
Logged

406man

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 46
Re: Redirects from old CPG galleries to new pages
« Reply #1 on: March 09, 2023, 11:09:12 am »

Checking a few things:
-   What web server is being used ?  Apache ?
-   Is this code you want to put in a .htaccess file ?

There are lots of examples available with a Google search such as on this site:
https://help.dreamhost.com/hc/en-us/articles/215747748-How-can-I-redirect-and-rewrite-my-URLs-with-an-htaccess-file-

Some of the examples are similar to your code.   

There’s a Regex tester here:
https://regex101.com/

…so you could try using the RewriteMatch directive and testing it in the above site.
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Redirects from old CPG galleries to new pages
« Reply #2 on: July 21, 2023, 02:22:56 am »

posted to solve this in the 1.5 misc board. Hopefully that's of some help to folks if they need it.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.