Redirection issues Redirection issues
 

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]

Main Menu

Redirection issues

Started by allvip, February 12, 2014, 04:14:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


allvip

the images that redirect have google path: furl=...allvip.us

the images that don't redirect have google path: furl=...www.allvip.us


allvip

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]


allvip

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

allvip

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.

Αndré

The redirect script works as expected, so you should ask your hosting provider for support regarding the cloud issue.

allvip

Yes.I know that.
I forgot to say in my last message that I will solve the problem with CloudFlare and the host.

allvip

I can help wonder if the code is ok header("Location: displayimage.php?pid=".$pid);
Should " be after $pid?

allvip

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 and even on 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.

Αndré

Quote from: allvip on February 13, 2014, 08:13:14 AM
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.


Quote from: allvip on February 13, 2014, 08:51:39 AM
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

allvip

the code from the docs redirect www to NON www

My rule redirects NON www to www.

allvip

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.

Αndré

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.

allvip

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/  riderects to www.allvip.us/cpg/test/ on all the pages.

Αndré

#14
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]

allvip

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


Αndré

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.

allvip

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.