1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Rewrite rule not working

Discussion in 'XenForo Questions and Support' started by SuperMonis, Oct 15, 2016.

  1. SuperMonis

    SuperMonis Member

    I'm trying to get a certain page on my website load in http instead of https because the page embeds other sites so it doesn't work correctly under https. The page is: https://creative-fun.net/vote

    From reading online, this rule should do that:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/vote$
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://creative-fun.net/$1 [R,L]

    And I've added it to the htaccess file for the site but this rule is not working, am I doing something wrong here?

    EDIT: so currently all templated pages on my site (e.g. forums, shoutbox, homepage, etc.) are loaded on whatever the user is currently on. If they're on http it loads it via that and if on https it loads via that.

    I want all these pages to be loaded by https - how do I configure it to do this without using rewrite rules (as Xenforo is blocking the required rules).

    The issue is that a custom page I created called 'vote' I want loaded over http - but all other pages over https.
    Last edited: Oct 15, 2016
  2. Petros

    Petros New Member

    Here it is what i use and works perfect
    #    Forcing url http to https
    RewriteCond %{HTTPSoff
    https://%{HTTP_HOST}%{REQUEST_URI} [L,NE,R=301]
    #    Forcing url http to https
  3. SuperMonis

    SuperMonis Member

    Thanks for the rule but that doesn't exclude the vote page. How would I add support for that?
  4. SuperMonis

    SuperMonis Member

    I currently have this Rewrite rule on my website.

        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule  ^forums/?$ https://creative-fun.net/forums/$1 [NC,L]
    Based on my knowledge this should redirect the following pages to https:
    But for some reason it only works for the first link. Does anyone know why this is ?
    (This rewrite rule is live and you're welcome to try it yourself)
  5. Petros

    Petros New Member

    Did you tested my above RewriteEngine?
  6. SuperMonis

    SuperMonis Member

    Yes - see my above reply.

    Your solution forces all pages to be https - which I don't want. I want all apart from the /vote page to.
  7. Petros

    Petros New Member

    In this case you can use my code to force all pages to https and to find another code to ignore specific page.

    I will see if i can find anything,i will let you know if i find anything which works

Share This Page