forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: allvip on February 12, 2014, 04:14:49 pm
-
[Edit: splitted from hotlinking to redirect to the page that contains the image (http://forum.coppermine-gallery.net/index.php/topic,76683.0.html)]
Is not always working.
http://www.google.com/imgres?biw=1024&bih=584&tbm=isch&tbnid=ARw1hNB26gsP5M%3A&imgrefurl=http%3A%2F%2Fallvip.us%2Fgallery%2Fdisplayimage.php%3Fpid%3D6143&docid=uh5QJG68zoJLBM&imgurl=http%3A%2F%2Fallvip.us%2Fgallery%2Falbums%2Fuserpics%2F10001%2Ftiffani_amber_thiessen_saved_by_the_bell_0006~0.jpg&w=1500&h=2229&ei=Q437Uv-IEIPNygOjw4HoCw&zoom=1&ved=0COQBEIQcMCc&iact=rc&dur=819&page=3&start=25&ndsp=15 (http://www.google.com/imgres?biw=1024&bih=584&tbm=isch&tbnid=ARw1hNB26gsP5M%3A&imgrefurl=http%3A%2F%2Fallvip.us%2Fgallery%2Fdisplayimage.php%3Fpid%3D6143&docid=uh5QJG68zoJLBM&imgurl=http%3A%2F%2Fallvip.us%2Fgallery%2Falbums%2Fuserpics%2F10001%2Ftiffani_amber_thiessen_saved_by_the_bell_0006~0.jpg&w=1500&h=2229&ei=Q437Uv-IEIPNygOjw4HoCw&zoom=1&ved=0COQBEIQcMCc&iact=rc&dur=819&page=3&start=25&ndsp=15)
click View Image - redirects to my gallery
http://www.google.com/imgres?biw=1024&bih=584&tbm=isch&tbnid=t21gUnPGPOmZEM%3A&imgrefurl=http%3A%2F%2Fwww.allvip.us%2Fgallery%2Fdisplayimage.php%3Fpid%3D6198&docid=xqbwoDZJcsNzjM&imgurl=http%3A%2F%2Fwww.allvip.us%2Fgallery%2Falbums%2Fuserpics%2F10001%2Ftiffani_amber_thiessen_saved_by_the_bell_0056~0.jpg&w=1500&h=2271&ei=Q437Uv-IEIPNygOjw4HoCw&zoom=1&ved=0CMMBEIQcMBw&iact=rc&dur=541&page=3&start=25&ndsp=15 (http://www.google.com/imgres?biw=1024&bih=584&tbm=isch&tbnid=t21gUnPGPOmZEM%3A&imgrefurl=http%3A%2F%2Fwww.allvip.us%2Fgallery%2Fdisplayimage.php%3Fpid%3D6198&docid=xqbwoDZJcsNzjM&imgurl=http%3A%2F%2Fwww.allvip.us%2Fgallery%2Falbums%2Fuserpics%2F10001%2Ftiffani_amber_thiessen_saved_by_the_bell_0056~0.jpg&w=1500&h=2271&ei=Q437Uv-IEIPNygOjw4HoCw&zoom=1&ved=0CMMBEIQcMBw&iact=rc&dur=541&page=3&start=25&ndsp=15)
click View Image - no redirect to my gallery,goes to full image.
-
the images that redirect have google path: furl=...allvip.us
the images that don't redirect have google path: furl=...www.allvip.us
-
Is working now.
I deleted the www. from .htaccess file.
I replaced:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?allvip.us [NC]
RewriteRule ^(.*\.(jpg|jpeg|png|gif))$ http://www.allvip.us/gallery/redirect.php?$1 [NC,R,L]
with:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?allvip.us [NC]
RewriteRule ^(.*\.(jpg|jpeg|png|gif))$ http://allvip.us/gallery/redirect.php?$1 [NC,R,L]
-
Maybe this happens because my host provider redirects allvip.us to www.allvip.us
They said they have to do that because my gallery takes to much cpu or something and I should have my website working under CloudFlare.
CloudFlare - A type records (without www) cannot be directly routed though the CloudFlare network so they redirect allvip.us to www.allvip.us
-
Deleteing the www. is not a good ideea.
All the gallery works without www. http://allvip.us/gallery/displayimage.php?pid=6198 not http://www.allvip.us/gallery/displayimage.php?pid=6198.
I put back the www. and is working fine.
I don't know why sometimes is not working.
I thing is a CloudFlare problem.Sometimes images don't even show on the page if CloudFlare is on.
-
The redirect script works as expected, so you should ask your hosting provider for support regarding the cloud issue.
-
Yes.I know that.
I forgot to say in my last message that I will solve the problem with CloudFlare and the host.
-
I can help wonder if the code is ok
header("Location: displayimage.php?pid=".$pid);
Should " be after $pid?
-
I have a .htaccess file with a simple rule provide by the host to redirect NON www to www in allvip.us root:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.allvip.us
RewriteRule (.*) http://www.allvip.us/$1 [R=301,L]
works fine on allvip.us/cpg/test (http://allvip.us/cpg/test) and even on allvip.us/gallery (http://allvip.us/gallery) but if the .htaccess for redirect.php is in allvip.us/gallery folder all the gallery pages without www will not redirect to www.
Something in the .htaccess form allvip.us/gallery folder that overides the rule NON www to www.
I have 24 hours with no sleep and I still don't know what is it.
all my domains are deleted from CloudFlare.
-
Should " be after $pid?
No. Of course it would also work if you re-structure it, but as I already said, the script works as expected.
Something in the .htaccess form allvip.us/gallery folder that overides the rule NON www to www.
Feel free to use the example from our docs: http://documentation.coppermine-gallery.net/en/bridging.htm#integrating_subdomain_www
-
the code from the docs redirect www to NON www
My rule redirects NON www to www.
-
I changed the code from the docs:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.allvip\.us$ [NC]
RewriteRule ^(.*) http://allvip.us/$1 [R,L]
to:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.allvip\.us$ [NC]
RewriteRule ^(.*) http://www.allvip.us/$1 [R,L]
I added the ! on the first line and www on the second and it works but non on allvip.us/gallery because of the htaccess for redirect.php.
When I delete the .htaccess from gallery folder all the riderect rules I find are working.
-
I just splitted your recent posts, as they're not related to the initial topic.
So you currently have issues with a htaccess file. Unfortunately I cannot track what the actual issue is. It seems you have different htaccess files for different purposes. Then, suddenly something else doesn't work as expected, but 5 minutes later this information is obsolete.
So please describe exactly what doesn't work. Post links! Post the content of the involved htaccess files. Describe how it is supposed to work.
-
under allvip.us I have an .htaccess to redirect all the pages allvip.us/... to www.allvip.us/....:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.allvip.us
RewriteRule (.*) http://www.allvip.us/$1 [R=301,L]
under allvip.us/gallery I have another .htaccess,redirect.php and no_hotlinking.html:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?allvip.us [NC]
RewriteRule ^(.*\.(jpg|jpeg|png|gif))$ http://www.allvip.us/gallery/redirect.php?$1 [NC,R,L]
allvip.us/gallery does not redirects to www.allvip.us/gallery because of the second .htaccess.
If I delete the second .htaccess (from folder gallery) allvip.us/gallery riderects to www.allvip.us/gallery
I have another coppermine gallery with demos that works as axpected: allvip.us/cpg/test/ (http://allvip.us/cpg/test/) riderects to www.allvip.us/cpg/test/ (http://www.allvip.us/cpg/test/) on all the pages.
-
Try this for your .htaccess file in /gallery/:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.allvip.us
RewriteRule (.*) http://www.allvip.us/gallery/$1 [R=301,L]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?allvip.us [NC]
RewriteRule ^(.*\.(jpg|jpeg|png|gif))$ http://www.allvip.us/gallery/redirect.php?$1 [NC,R,L]
-
Not Found
The requested URL /index.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
-
allvip.us/gallery redirect to www.allvip.us
allvip.us/gallery/index.php redirects to http://www.allvip.us/index.php
-
I just replaced
RewriteRule (.*) http://www.allvip.us/$1 [R=301,L]
with
RewriteRule (.*) http://www.allvip.us/gallery/$1 [R=301,L]
in my above code.
-
You are life saver all the time with a lot of patience ;D
Thanks a lot.I can start CloudFlare now.CloudFlare has no point if users access the site without www.CoudFlare runs only for www.