0

First time posting here. I'm kind of new in this whole web/server setup world, so bear with me!

Basically, I have a web forum and I've been trying to implement HTTPS on it for a while. And it works, for example, if I put https://example.comon the adress bar, the forum works perfectly like a charm.

However, my problem is that if I simply put example.com on the adress bar, it defaults to the http counterpart, being http://example.com.

I've read many guides on how to do this, and I've already added the necessary .htaccess rules (I think) for the redirect.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This is the important part I think, the ones below here were automatically generated by the forum software, I think.

RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA]
RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA]
RewriteRule ^thread-([0-9]+)\.html$ showthread.php?tid=$1 [L,QSA]
RewriteRule ^thread-([0-9]+)-page-([0-9]+)\.html$ showthread.php?tid=$1&page=$2 [L,QSA]
RewriteRule ^thread-([0-9]+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost [L,QSA]
RewriteRule ^thread-([0-9]+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest [L,QSA]
RewriteRule ^thread-([0-9]+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest [L,QSA]
RewriteRule ^thread-([0-9]+)-newpost\.html$ showthread.php?tid=$1&action=newpost [L,QSA]
RewriteRule ^thread-([0-9]+)-post-([0-9]+)\.html$ showthread.php?tid=$1&pid=$2 [L,QSA]

RewriteRule ^post-([0-9]+)\.html$ showthread.php?pid=$1 [L,QSA]

RewriteRule ^announcement-([0-9]+)\.html$ announcements.php?aid=$1 [L,QSA]

RewriteRule ^user-([0-9]+)\.html$ member.php?action=profile&uid=$1 [L,QSA]

RewriteRule ^calendar-([0-9]+)\.html$ calendar.php?calendar=$1 [L,QSA]
RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]
RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+)\.html$ calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]

RewriteRule ^event-([0-9]+)\.html$ calendar.php?action=event&eid=$1 [L,QSA]

<IfModule mod_env.c>

So, any ideas? Is this an issue with the domain host configuration? I appreciate the help.

Vist4w
  • 1

1 Answers1

0

The purpose of enclosing everything in an <IfModule mod_rewrite.c> is to suppress errors in case the mod_rewrite module isn't loaded. So the first thing you can check for is whether that module is loaded, because if it isn't no redirects will work. On most Apache installations it will be loaded, though.

Another thing to check is whether .htaccess files are enabled in your Apache configuration and whether they are given the ability to contain arbitrary configuration (such as the rules you've added there). In your Apache configuration look for an AllowOverride statement. It should be set to All. You may have to check inside a relevant <Directory> section.

Another thing to check is Apache's error log, which can sometimes reveal when configuration problems are affecting something.

thomasrutter
  • 2,527
  • 1
  • 25
  • 34