Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2004
    Location
    Newport, Wales
    Posts
    283
    Plugin Contributions
    0

    Default HTTPS on entire site - getting some redirect issues

    Hi
    Recently I decided to take the plunge and go completely HTTPS on my new site mandangle.co.uk however there are a few issue relating to it that are causing me a few problems which hopefully someone can help with.

    Basically I have set both config files to HTTPS with enable SSL to true which does the job if you click on links as if you were a customer but Google then indexed the site and I discovered there were a few issues.

    The first was that if you arrived at the site using a http link the site automatically sends you to HTTPSs on the following click but then adds a session ID to the end of the url which then also occurs on all subsequent urls.

    The second is that if I add a redirect to the htaccess file like this

    Code:
    ##  Redirect non www to www and also redirect HTTP to HTTPS
    RewriteCond %{HTTPS} off
    # First rewrite to HTTPS:
    # Don't put www. here. If it is already there it will be included, if not
    # the subsequent rule will catch it.
    RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # Now, rewrite any request to the wrong domain to use www.
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    I find I get an error because some pages redirect to the homepage while other work fine which has me seriously stumped.

    For example is you launch this page https://www.mandangle.co.uk/man-candles then remove the s in HTTPS it takes you to the home page whereas other pages work just fine and redirect to the same HTTPS page . (This issue was made apparent as a result of a site audit )

    Google also only shows around 50 links when there are over 100 so I wanted to make sure the above mentions were not a factor.

    So if anyone has any ideas of what I may be doing wrong or any pointers it would be appreciated.

    Cheers
    Brinley

  2. #2
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: HTTPS on entire site - getting some redirect issues

    I'm not seeing a problem when trying to access the site, though with your htaccess, I got redirected twice when I entered: http://mandangle.co.uk/man-candles

    As a result of 1) the first rule changes to https, but then stops processing [L] command, and doesn't immediately move to the next rule to add the www.

    Haven't fully thought it out, but would do differently...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Aug 2004
    Location
    Newport, Wales
    Posts
    283
    Plugin Contributions
    0

    Default Re: HTTPS on entire site - getting some redirect issues

    Quote Originally Posted by mc12345678 View Post
    I'm not seeing a problem when trying to access the site, though with your htaccess, I got redirected twice when I entered: http://mandangle.co.uk/man-candles

    As a result of 1) the first rule changes to https, but then stops processing [L] command, and doesn't immediately move to the next rule to add the www.

    Haven't fully thought it out, but would do differently...

    Weird as it gives me both https and www so I get https://www.mandangle.co.uk/man-candles and if I then amend the url by removing the s off HTTPS it takes me to https://www.mandangle.co.uk/

    All a tad confusing at the moment

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: HTTPS on entire site - getting some redirect issues

    Maybe something amuck with your URL-Rewrite rules which change the default ZC URLs to all those words instead of native URLs?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Aug 2004
    Location
    Newport, Wales
    Posts
    283
    Plugin Contributions
    0

    Default Re: HTTPS on entire site - getting some redirect issues

    Quote Originally Posted by DrByte View Post
    Maybe something amuck with your URL-Rewrite rules which change the default ZC URLs to all those words instead of native URLs?
    Hi Doc! Yup you are correct again - I am using Conor's URI mapping plugin and turning it off resolves the issue.

    Unfortunately my knowledge of redirecting is non-existent so hopefully someone else out there has come across this issue and resolved it.

    Cheers
    Brinley

  6. #6
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: HTTPS on entire site - getting some redirect issues

    Quote Originally Posted by welshop.com View Post
    Hi Doc! Yup you are correct again - I am using Conor's URI mapping plugin and turning it off resolves the issue.

    Unfortunately my knowledge of redirecting is non-existent so hopefully someone else out there has come across this issue and resolved it.

    Cheers
    Brinley
    It's not so much of an off or on issue, but like described above a sequencing/htaccess issue. When troubleshooting htaccess problems, everything (except the actual admin directory pathname) is important.

    So, please provide your complete .htaccess but obscure your admin directory (normally entered as part of Connor's CEON URI Mapping .htaccess rules). Then might be able to help. If there is anything else that is to remain secure about something specific, please describe it as best as possible omitting the "secure" detail.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Aug 2004
    Location
    Newport, Wales
    Posts
    283
    Plugin Contributions
    0

    Default Re: HTTPS on entire site - getting some redirect issues

    Thank for the offer of help.

    Here is the full htaccess file with admin obscured in CEON mapping - the rest are all acquired from the web, so nothing fancy.

    I did try rearrange the sequencing of the sections but because of my lack of knowledge it was merely an experiment in hit and hope that obviously came to nothing.

    Cheers
    Brinley



    Code:
    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 1 month"
    </IfModule>
    ## EXPIRES CACHING ##
    
    ##  Redirect non www to www and also redirect HTTP to HTTPS
    RewriteCond %{HTTPS} off
    # First rewrite to HTTPS:
    # Don't put www. here. If it is already there it will be included, if not
    # the subsequent rule will catch it.
    RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # Now, rewrite any request to the wrong domain to use www.
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    ### PAGE NOT FOUND ###
    ErrorDocument 404 https://www.mandangle.co.uk/index.php?main_page=page_not_found
    
    
    # compress text, HTML, JavaScript, CSS, and XML - copied from GTmetrix Gzip page
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    
    
    
    
    ## BEGIN CEON URI MAPPING REWRITE RULE
    
    RewriteEngine On
    
    # Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
    RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
    # Don't rewrite any URIs for some, popular specific file format extensions,
    #   which are not covered by main file extension condition above
    RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
    # Don't rewrite any URIs for some specific file format extensions,
    #   which are not covered by main file extension condition above
    #   Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
    #RewriteCond %{REQUEST_URI} !\.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
    # Don't rewrite admin directory
    RewriteCond %{REQUEST_URI} !^/XXXXXXXXXX_XX [NC]
    # Don't rewrite editors directory
    RewriteCond %{REQUEST_URI} !^/editors/ [NC]
    # Don't rewrite pdf directory
    RewriteCond %{REQUEST_URI} !^/pdf/ [NC]
    # Don't rewrite psd directory
    RewriteCond %{REQUEST_URI} !^/psd/ [NC]
    # Don't rewrite generator directory
    RewriteCond %{REQUEST_URI} !^/generator/ [NC]
    # Don't rewrite mailhive directory
    RewriteCond %{REQUEST_URI} !^/mailhive/ [NC]
    # Don't rewrite cgi-bin directory
    RewriteCond %{REQUEST_URI} !^/cgi\-bin/ [NC]
    # Handle all other URIs using Zen Cart (its index.php)
    RewriteRule .* index.php [QSA,L]
    
    ## END CEON URI MAPPING REWRITE RULE

  8. #8
    Join Date
    Aug 2004
    Location
    Newport, Wales
    Posts
    283
    Plugin Contributions
    0

    Default Re: HTTPS on entire site - getting some redirect issues

    I have had another look at the sequencing and tweaked it as detailed below which seems to now work but it would be nice to get the thumbs up just in case because there is not much on the web detailing the ins and outs of Htaccess.

    ps: I have only included the RewriteCondition code as apparently this is the only section dependant on sequencing.

    Cheers
    Brinley

    ## Redirect non www to www and also redirect HTTP to HTTPS
    RewriteEngine On
    RewriteCond %{HTTPS} off
    # First rewrite to HTTPS:
    # Don't put www. here. If it is already there it will be included, if not
    # the subsequent rule will catch it.
    RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # Now, rewrite any request to the wrong domain to use www.
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    ## BEGIN CEON URI MAPPING REWRITE RULE

    # RewriteEngine On - Edited out becaause of Engine on clause above
    # Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
    RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
    # Don't rewrite any URIs for some, popular specific file format extensions,
    # which are not covered by main file extension condition above
    RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
    # Don't rewrite any URIs for some specific file format extensions,
    # which are not covered by main file extension condition above
    # Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
    #RewriteCond %{REQUEST_URI} !\.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
    # Don't rewrite admin directory
    RewriteCond %{REQUEST_URI} !^/YOURADMIN [NC]
    # Don't rewrite editors directory
    RewriteCond %{REQUEST_URI} !^/editors/ [NC]
    # Don't rewrite pdf directory
    RewriteCond %{REQUEST_URI} !^/pdf/ [NC]
    # Don't rewrite psd directory
    RewriteCond %{REQUEST_URI} !^/psd/ [NC]
    # Don't rewrite generator directory
    RewriteCond %{REQUEST_URI} !^/generator/ [NC]
    # Don't rewrite mailhive directory
    RewriteCond %{REQUEST_URI} !^/mailhive/ [NC]
    # Don't rewrite cgi-bin directory
    RewriteCond %{REQUEST_URI} !^/cgi\-bin/ [NC]
    # Handle all other URIs using Zen Cart (its index.php)
    RewriteRule .* index.php [QSA,L]



    ## END CEON URI MAPPING REWRITE RULE

 

 

Similar Threads

  1. having some issues with ez pages, header getting cut off bad positioning etc...
    By ICwater in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 21 Nov 2012, 08:17 PM
  2. v151 Email Issues for admin - not getting some of them!
    By mzunderstood in forum General Questions
    Replies: 5
    Last Post: 20 Nov 2012, 05:12 AM
  3. v139h Some issues with moving site up one level
    By mudpit in forum General Questions
    Replies: 1
    Last Post: 14 Mar 2012, 02:48 AM
  4. https url getting added to some packing slips
    By whitknits in forum Managing Customers and Orders
    Replies: 2
    Last Post: 6 Jan 2011, 12:27 PM
  5. Host forcing me to use https across entire site?
    By morr in forum General Questions
    Replies: 16
    Last Post: 18 Nov 2010, 10:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR