We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

How do I force all traffic over https? | Forum

Jason M
Jason M Feb 21 '14
Hi all,
We installed the software to run over https.  Our server admin installed a ssl certificate running on our ip address but when we update the .htaccess file to force all of the traffic over https all of the site links break. (meaning the index page loads but when you click any tab there is a 404 error.

I know this might be a path error in the htaccess file I have found.  Anyone have any thoughts or an example of an htaccess file that works on version 1.6.0?

Thanks, we are trying to get this community off the ground.

Jason
Jason M
Jason M Feb 24 '14
Yes, the config file is correct.   When I edit the .htaccess file all of the sitelinks replacing the RewriteRule to index.php break instantly.

If I leave that line and change it to:
RewriteRule ^(.*)$ https://bbqcommunity.com/$1 [R,L]
RewriteRule (.*) index.php

The redirect works, tabs work but deeper links break such as photos and infrastructure.

I am missing a catch-all path like /.* or something else.

I appreciate your help resolving this Chris.

Jason
The Forum post is edited by Jason M Feb 24 '14
Attachments:
  bbq_community_error.jpg (290.53Kb)
Jason M
Jason M Feb 28 '14
Has anyone implemented any work arounds to force all traffic successfully over https without causing an application error?


Jason

Jason M
Jason M Mar 16 '14
sorry for the delay in posting but yes, once the .htaccess file is edited all home page links break across the board.


Jason

tammy harris
tammy harris Mar 16 '14
My site is run full https no worries and with out have to mod htacess 
Jason M
Jason M Mar 16 '14
Tammy,  we are running full https as well but we want all traffic including when someone types in bbqcommunity to automatically go https://bbqcommunity.com so all traffic is run secure.


are you forcing all traffic over https?


Jason

tammy harris
tammy harris Mar 17 '14
no if your server is set up right it auto serves https up what ever is typed in be it http or even just www   all goes to https

the setting is in whm cpanel somewhere but just cant remember it if i come across it il let you know
tammy harris
tammy harris Mar 17 '14
if you dont have whm   can do same sort of thing in cpanel do a redirection http to https
Unus
Unus Feb 27 '16
hi all

I am having headaches setting my https 


I have switched on config.php to https and restarted the apache server.

right now if I am going to http://mysite.com or https://mysite.com it is loading correctly (showing the https/ssl cert nicely)  BUT from there on any button/link I click they are broken

  https://__mysite__com/index  -- broken

  https://__mysite__com/join      -- broken

  https://__mysite__com/users     -- broken

  https://__mysite__com/events     -- broken


ALL return 404 

The requested URL /events was not found on this server.

Apache/2.4.7 (Ubuntu) Server at __mysite__com Port 443


what should I do next? 


thank you

Unus

The Forum post is edited by Unus Feb 27 '16
Unus
Unus Feb 27 '16
one more thing: if I switch back to http in config.php


all the links work except the "home" which gets the browser to http://__mysite__.com/index and this one is the only one that returns 404.

he requested URL /events was not found on this server.

Apache/2.4.7 (Ubuntu) Server at __mysite__com Port 80

now, if I go ahead and create a dummy index.html and place it next to index.php this page works great too. 

I am lost... can someone shed some light?


here's my .htaccess cause you probably want to see it:


Options +FollowSymLinks
RewriteEngine On

AddEncoding gzip .gz
AddEncoding gzip .gzip
<FilesMatch "\.(js.gz|js.gzip)$">
ForceType text/javascript
</FilesMatch>
<FilesMatch "\.(css.gz|css.gzip)$">
ForceType text/css
</FilesMatch>

RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/
RewriteCond %{REQUEST_URI} !/ow_cron/run\.php
RewriteCond %{REQUEST_URI} !/e500\.php
RewriteCond %{REQUEST_URI} !/captcha\.php
#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php


Unus
Unus Feb 27 '16
ok, I solved it. 


the ssl works, all you have to do is to switch the http to https in the config.php

not redirect is needed, that was a major disturbance for me and led me to wrong paths and a lot of headache. 


but you have to make sure you have this in your site.conf file site-ssl.conf file (apache2 ubuntu 14)


DirectoryIndex index.php index.html index.shtml index.htm default.html Default.htm default.html Default.html default.shtml Default.shtml page1.html index.pl index.cgi index.php3 index.phtml home.htm home.html home.shtml index.wml


Options FollowSymLinks
AllowOverride All


Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all


ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all




The Forum post is edited by Unus Feb 27 '16