#1
  1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Nov 2010
    Location
    Europe
    Posts
    2
    Rep Power
    0

    How to exclude a single page from htaccess rules?


    Hi
    I have 2 rules in my htaccess that
    - force the use of www. in front of domain name
    - redirect all urls from http to https

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^terapiadicoppiabrescia.it [NC]
    RewriteRule ^(.*)$ http://www.terapiadicoppiabrescia.it/$1 [L,R=301]

    RewriteCond %{HTTPS} !=on
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

    My problem is that I have 1 page that must be opened in http only, and never in https
    How could I get that?

    Thank you
  2. #2
  3. SEO Insultant
    SEO Chat Mastermind (5000+ posts)

    Join Date
    Oct 2005
    Location
    sharing a room with my ego
    Posts
    6,325
    Rep Power
    3163
    I think you can add another "RewriteCond" to the second set of rules, that checks if %{REQUEST_URI}
    -- or maybe %{REQUEST_FILENAME} or whatever -- does NOT match your excluded webpage.

    Be careful with your experiments though...
  4. #3
  5. SEO Insultant
    SEO Chat Mastermind (5000+ posts)

    Join Date
    Oct 2005
    Location
    sharing a room with my ego
    Posts
    6,325
    Rep Power
    3163
    I've just tested this, and it works.

    Just add something like this, directly below the line with %{HTTPS} !=on in it....
    RewriteCond %{REQUEST_URI} !ExcludeThisURI.html

    Of course you have to replace the ExcludeThisURI.html bit with the actual URI
    of the webpage you want ignored.

    Just be sure to:
    - not forget the exclamation mark!
    - only add just enough of the complete URI to hit all possible permutations
    - not make the URI too short, however, because that might lead to other webpages giving
    false positives.

    Comments on this post

    • Donald agrees
    • Will-O-The-Wisp agrees
    Last edited by dzine; Oct 17th, 2016 at 06:25 AM.
    ... Hey you! FREE SEO report card ... I really my hosting company ...
  6. #4
  7. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Nov 2010
    Location
    Europe
    Posts
    2
    Rep Power
    0
    Perfect!
    It works very well thank you

Similar Threads

  1. when I paste mod-expire rules in my htaccess I get an internal error!!!
    By hovhannes999 in forum Search Engine Optimization
    Replies: 7
    Last Post: Nov 27th, 2015, 12:16 PM
  2. Senate: Exclude car dealers from consumer rules (AP)
    By RSS_News_User in forum Business News
    Replies: 0
    Last Post: May 24th, 2010, 06:01 PM
  3. Single page website and better Page Ranking
    By LuvToRekord in forum SEO Help (General Chat)
    Replies: 8
    Last Post: Jan 10th, 2009, 04:17 AM
  4. How to track multiple clicks on a single page(home page)?
    By jewelry123 in forum Analytics Analysis
    Replies: 0
    Last Post: Jul 28th, 2008, 07:54 AM
  5. How to exclude a single word/phrase from SE indexing?
    By Austell in forum Search Engine Optimization
    Replies: 11
    Last Post: Aug 28th, 2007, 01:53 AM

IMN logo majestic logo threadwatch logo seochat tools logo