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.
You are not logged in.
Hi,
All is in the question;
I would redirect ( with a transparent redirection) my home page (Index Page) to an album with htaccess
I find this:
RewriteRule ^index.php$ /galleries/stock/index.php [L]
It redirect my home page to the right page without modify the browser adress (Who stay https://phototheque.nicolaslogerot.com and not https://phototheque.nicolaslogerot.com/ … es/stock/) as I want but this redirect all the other page to an 404 error.
If I try with ^$ who is normally the root but it don't works:
RewriteRule ^$ /galleries/stock/index.php [L]
Is anyone has an idea please?
Thanks
Nico
Last edited by Nico3939 (2019-06-05 23:43:22)
Offline
I found a solution that seems to work.
By adding a test so that only the call to the root goes into proxy.
Code:
RewriteCond %{HTTP_HOST} ^phototheque.nicolaslogerot.com$ [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ /galleries/stock/ [L]
Offline
Hi all,
Has anyone managed to get an album appearing on their homepage as per the instructions from Nico above?
My .htaccess file looks as below, but the redirection is not working:
<IfModule mod_headers.c>
<FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteCond %{REQUEST_URI}::$1 ^(.*?/)(.*)::\2$
#RewriteRule ^(.*)$ - [E=BASE:%1]
##RewriteRule ^(.*)$ - [E=BASE:]
RewriteBase /
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
RewriteRule ^.*$ - [E=BASE:%2]
RewriteRule ^(.*)$ - [E=QS:mod_rewrite=on]
RewriteRule ^([^\/.]*)-single.php$ %{ENV:BASE}single.php?%{ENV:QS}&id=$1 [QSA,L]
RewriteRule ^([^\/.]*).css$ %{ENV:BASE}index.php?%{ENV:QS}&extension=css&name=$1 [QSA,L]
RewriteRule ^([^\/.]*).js$ %{ENV:BASE}index.php?%{ENV:QS}&extension=js&name=$1 [QSA,L]
RewriteRule ^([^\/.]*).gif$ %{ENV:BASE}index.php?%{ENV:QS}&extension=gif&name=$1 [QSA,L]
RewriteRule ^([^\/.]*).png$ %{ENV:BASE}index.php?%{ENV:QS}&extension=png&name=$1 [QSA,L]
RewriteRule ^([^\/.]*).jpg$ %{ENV:BASE}index.php?%{ENV:QS}&extension=jpg&name=$1 [QSA,L]
#RewriteCond %{QUERY_STRING} !mod_rewrite=on
#RewriteRule ^index.php$ %{ENV:BASE}index.php?%{ENV:QS} [QSA,L]
RewriteCond %{QUERY_STRING} !mod_rewrite=on
RewriteRule ^mobile.php$ %{ENV:BASE}mobile.php?%{ENV:QS} [QSA,L]
RewriteCond %{QUERY_STRING} !mod_rewrite=on
RewriteRule ^(.*)download.php %{ENV:BASE}download.php?%{ENV:QS} [QSA,L]
#RewriteRule ^/?$ index.php [QSA,L]
RewriteRule ^$ %{ENV:BASE}index.php?%{ENV:QS} [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ %{ENV:BASE}index.php?%{ENV:QS}&page=$1 [QSA,L]
RewriteCond %{HTTP_HOST} ^tasmanianphotos.com$ [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ /galleries/tasmania/ [L]
</IfModule>
Offline
Is there a reason to do this via .htaccess rather than just embedding the album on the home page?
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Hi Rod,
Not sure which is best - but was just following Nico's lead here.
Funny the code above wasn't working/redirecting with Chrome but is with IE.
I managed to find the code below that seems to work on both Chrome and IE so I will use that.
Thank you for you help again.
RewriteCond %{HTTP_HOST} !^(www\.tasmanianphotos\.com)?$
RewriteRule ^(.*)$ http://www.tasmanianphotos.com/$1 [R=301]
RewriteCond %{REQUEST_URI} !/galleries/tasmania/
RewriteRule ^(.*)$ /galleries/tasmania/$1 [L]
Offline
hmmm.... but you can integrate a gallery on the front page and get the same effect, can't you?
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Hi Daniel,
Will need to look closer to answer your question - I'm still very new at this.
I am trying to get a "stock images" page together similar to Nico's at:
https://phototheque.nicolaslogerot.com
Would there be a reason not do the redirect now it's working
Cheers,
Chumby
Offline
I have a slow internet connection. Between the original page loaded and I added a reply, you already posted an update....
I try not to touch .htaccess if not necessary and stick with Backlight 2 native solutions, if possible.
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Ok, thanks - that makes sense Daniel.
I will clean up the htaccess file then and then try to embed the album on the front page.
Do you know off hand the method for doing that? Is there a setting in "Edit-Top-Level_Gallery" or somewhere else?
Cheers
Chumby
Offline
Edit your Home Page in Backlight > Designer > Pages. Click Design next to your Home page. Click on Insert Album. Then just choose the album.
http://backlight.theturninggate.net/doc … r-pages-b2
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Cheers Rod... will check it out.
Offline
hummm ... I admit I don't remember how I did it anymore, I look and come back here
Offline
I don't really remember how I did it (almost 1 year now).
Here is my htacess:
<IfModule mod_headers.c>
<FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(.*?/)(.*)::\2$
RewriteRule ^(.*)$ - [E=BASE:%1]
# RewriteRule ^(.*)$ - [E=BASE:]
# RewriteBase /backlight/
# RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
# RewriteRule ^.*$ - [E=BASE:%2]
RewriteRule ^(.*)$ - [E=QS:mod_rewrite=on]
RewriteRule ^/?search\/?$ %{ENV:BASE}index.php?%{ENV:QS}&m=publisher&c=gallery&a=search [QSA,L]
RewriteRule ^/?([a-zA-Z_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)\/?$ %{ENV:BASE}index.php?%{ENV:QS}&m=$1&c=$2&a=$3&p1=$4&p2=$5&p3=$6&htline=1 [QSA,L]
RewriteRule ^/?([a-zA-Z_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)\/?$ %{ENV:BASE}index.php?%{ENV:QS}&m=$1&c=$2&a=$3&p1=$4&p2=$5&htline=2 [QSA,L]
RewriteRule ^/?([a-zA-Z_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)\/?$ %{ENV:BASE}index.php?%{ENV:QS}&m=$1&c=$2&a=$3&p1=$4&htline=3 [QSA,L]
RewriteRule ^/?([a-zA-Z_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)\/?$ %{ENV:BASE}index.php?%{ENV:QS}&m=$1&c=$2&a=$3&htline=4 [QSA,L]
RewriteRule ^/?([a-zA-Z_\-]+)/([a-zA-Z0-9_\-]+)\/?$ %{ENV:BASE}index.php?%{ENV:QS}&m=$1&c=$2&htline=5 [QSA,L]
RewriteRule ^/?([a-zA-Z_\-]+)\/?$ %{ENV:BASE}index.php?%{ENV:QS}&m=$1&htline=6 [QSA,L]
# Enable passing of mod_rewrite for /backlight/ site root
RewriteRule ^$ %{ENV:BASE}index.php?%{ENV:QS}&htline=7 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ %{ENV:BASE}index.php?%{ENV:QS}&htline=8 [QSA,L]
</IfModule>
Note: # lines are for my maintenance page
Offline
For information my home page is an album published from lightroom in which I wrote the html directly in "Page Content" "Main Copy" in:
Backlight> Publisher> Galleries> Albums
Last edited by Nico3939 (2020-01-10 00:33:47)
Offline