Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2017-11-16 18:07:12

JimR
Member
Registered: 2012-11-30
Posts: 348
Website

htaccess and redirects

I'm so baffled by the Backlight htaccess rules. It's just total voodoo to me right now. When I find strange things happening on my site, it gets down to Backlight's htaccess. I've been deleting them all my "problem" directories. When they're gone, everything seems to work just fine. When they're there, I eventually find them to be the source of mysterious problems.

The latest issue is that I renamed several old directories in the new site. To create the redirects, I first tried using the cpanel for my site. But that wasn't working (probably due to Backlight's htaccess). Then I found that it's easier to do this within the WordPress plugin Redirection.


All of my portfolio is within the main directory /photos/ (typically named /galleries/ but I've set all of TTG and Backlight to be based on /photos/). Here's how my site is structured, from the root directory.

/backlight/
/photos/
/photos/gallery-1/
/photos/gallery-2/
/photos/gallery-n/
/photos/99-models/gallery-1/
/photos/99-models/gallery-2/
/photos/99-models/gallery-n/


I created all the rules in Redirection for all the renamed galleries, and they work, so long as I don't have the Backlight /photos/.htaccess file.

Here's an example of what I've got. The old directory was /photos/99models/ and is now /photos/99-models/. Within /photos/99-models/ there are dozens of more directories. The regex rule for this is:

Source: /photos/99models(.+)
Destination: /photos/99-models$1

That works great in the WordPress plugin Redirection, when there is no Backlight /photos/.htaccess file.

I tried writing the same rule above within Backlight /photos/.htaccess but I couldn't get that to work. So I'm always coming back to, Backlight's htaccess file always causes problems for me yet if I remove it nothing "bad" seems to happen.

Backlight adds a htaccess file into every one of its pages and albums. But I found those don't seem to cause a problem. It's only the one in the main directory /photos/.htaccess.


Can someone explain what are the rules in Backlight's htaccess file?

Will anything "bad" happen if I simply remove all of them?

Do I really need the Backlight htaccess files?

If I should keep it, then how do I redirect the dozens of directories that I renamed?


--Jim

Offline

#2 2017-11-16 19:10:04

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: htaccess and redirects

Hi Jim, I reckon the /galleries/.htaccess files (and equivalent in places such as /photos/) is redundant.  Earlier versions of Backlight loaded stylesheets and scripts at URLs under the album, album set and top-level gallery directory that the user was viewing.  Those calls needed the .htaccess files.  These are now called to URLs under /backlight/publisher/.  Note that the album and album set .htaccess files are still needed, for handling of single-photo123.html-type URLs.

I suggest using your own .htaccess files there, and keeping an eye on any side-effects.

Offline

Board footer

Powered by FluxBB