Welcome to WebmasterWorld Guest from 54.145.176.120

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Help redirecting bookmarked urls from HTTPS to HTTP

   
3:47 am on May 27, 2011 (gmt 0)



Hello, I have stumbled upon your site and have learned a lot looking at previous posts but I still having a problem. I have inherited a problem on an existing site that I did not create that used to redirect all pages to HTTPS via the .htaccess file in the public_html root of the website. I have attempted to fix the issue but cannot seem to stop the non-SSL pages from displaying with HTTPS when requested by either a bookmark or just by typing in the URL with the HTTPS in front. Here is the code I have so far including things Ive tried that are commented out. When I type the link with [debnroo.com,...] the site does not redirect to http. If I type the site with www.debnroo.com, it works fine and displays wiht http. Can someone help me please, been struggling with this for over 4 days now:

RewriteEngine On
#RewriteBase /~debnroo

#RewriteCond %{HTTPS} on
RewriteCond %{SERVER_PORT} =443
RewriteCond %{HTTP_HOST} ^debnroo.com
#RewriteCond %{REQUEST_URI} !^.*Cart/.*$
#RewriteCond %{REQUEST_URI} !^.*Checkout/.*$
RewriteCond $1 !^(Cart|Checkout)
RewriteCond $1 !\.(gif|jpe?g|png|ico|css|js)$
#RewriteRule ^(.*)$ [debnroo.com...] [R=301,L]
RewriteRule ^(.*)$ [%{HTTP_HOST}...] [R=301,L]

#RewriteCond %{HTTPS} off
RewriteCond %{SERVER_PORT} !=443
RewriteCond %{HTTP_HOST} !^.*spicycart.com$
RewriteCond %{HTTP_HOST} !^.*weauction4you.com$
RewriteCond %{HTTP_HOST} !^.*tablesinbags.com$
RewriteCond %{SCRIPT_FILENAME} !(about|products).php$
#RewriteCond %{REQUEST_URI} ^.*Checkout/.*$
#RewriteCond %{REQUEST_URI} ^.*Cart/.*$
#RewriteCond %{REQUEST_URI} ^((viewcart|viewcheckout)\.php)$
RewriteCond $1 ^(Cart|Checkout)
#RewriteRule !^.*(jpg|png|gif|jpeg).*$ [%{HTTP_HOST}%{REQUEST_URI}...] [R=301,L]
RewriteRule !^.*(jpg|png|gif|jpeg).*$ [%{HTTP_HOST}...] [R=301,L]

RewriteRule ^.*Cart/.*$ viewcart.php [QSA,L]

RewriteRule ^.*Checkout/.*$ viewcheckout.php [QSA,L]
12:17 am on May 28, 2011 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The first step (and the first thing you need to know) is that you'll need to flush (completely delete) your browser cache before testing, and again after making any change to your server-side code.

Otherwise, your browser will very likely show you a previously-cached local copy of the page, and no HTTP request will be sent to your server. Since this code is server-side, it won't get a chance to execute, and therefore, you'll see no 'fix-up' redirect...

Having tested with an empty cache, let us know what problems remain. The code could do with a bit of cleaning-up, but I don't want to go off-track.

Jim
8:26 am on May 29, 2011 (gmt 0)



Thank you jdmorgan for replying to my post. I have deleted my browser cache and typed in [debnroo.com...] and still the webpage displays with the IE 8 error prompt asking if I want to display the secure content only. You mentioned that the code could use some cleaning, do you have any other suggestions for me?
8:31 am on May 29, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Every line of code has one to three changes that needs to be made.

I'll post later in the day when I have more time.
7:36 pm on May 31, 2011 (gmt 0)



Oh wow, every line has up to 3 issues... That is not good, can you elaborate please? I'm new to Apache and these redirect rules, not sure what all needs to change. Any help would be appreciated.
3:32 am on Jun 6, 2011 (gmt 0)



I still need help with this issue, I have found hard-coded links in various php scripts and have changed them to http(they were hardcoded as https). I thought the redirects would handle this for me but it doesnt seem to work that way. I also searched for *.conf files but didnt find any, the site is hosted via hostgator on a dedicated server from what I know so not sure they give access to a httpd.conf file? I'm still confused as to why the redirects are not working? Would appreciate more advice. Thanks
 

Featured Threads

Hot Threads This Week

Hot Threads This Month