.htaccess to remove index.php and force a subdirectory to SSL (i.e. “I want a secure wiki”)
Posted: 14 June 2008 10:34 AM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

I’m removing index.php from my site, which works fine using the simplest “file and directory check” method. I have a Wiki that’s for my eyes only (controlled first at the template level), but I’d additionally like to force the Wiki to use SSL (I have a certificate installed).

I can get it to work like this:

RewriteCond %{REQUEST_URI} wiki
RewriteCond
%{SERVER_PORT} !^443$
RewriteRule (.*) https://www.masugadesign.com/$1 [R=301,L]

But that still adds “index.php” to the URL, which I don’t want. I’m missing some small part of that equation.

Also, I’m assuming I should go into the wiki templates and change something so all links start with “https://”? Or is that not possible? I see variables like “{path:view_category}” and I’m pretty sure there isn’t a “{securepath:view_category}” version.

Any help with the htaccess appreciated

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 22 June 2008 11:04 AM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

Nothing doing, eh?

I’d settle for being able to make all the links the wiki generates start with “https” - ideally without hacking a core file.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 22 June 2008 01:36 PM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  29218
Joined  05-15-2004

Try adding index.php in the rule, but not the rewrite, like so:

RewriteCond %{REQUEST_URI} wiki
RewriteCond
%{SERVER_PORT} !^443$
RewriteRule index.php/(.*) https://www.masugadesign.com/$1 [R=301,L]

Also, I’m assuming I should go into the wiki templates and change something so all links start with “https://”? Or is that not possible?

I am not aware of any config option. You’d probably need to rewrite every http:// to https://. If you (and the wiki—not sure) are using relative URLs, this won’t be an issue.

Untested.

 Signature 

ExpressionEngine 2.0 Downloads | Docs | Bugtracker

“If the English language made any sense, lackadaisical would have something to do with a shortage of flowers.” (Doug Larson)

Profile
MSG
 
 
Posted: 22 June 2008 01:43 PM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

Ingmar, that seemed to work fine for forcing the Wiki links to go to “https”, thanks for your help.

It would probably be more efficient for the auto-generated Wiki links to just spit out “https://” in ther first place, but I looked at the core files and don’t see how I’d do that easily in the first place, as those auto-generated links are so dependent on various internal link-making functions already.

This will work fine for now, though. Thanks!

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 23 June 2008 04:16 PM   [ Ignore ]   [ # 4 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

Unfortunately, I just tried updating my Wiki, the browser does throw an error saying my update will be unencrypted, even though the page is encrypted. Even if I click continue, my update isn’t saved.

Hasn’t anyone else come across the need to create a protected Wiki that holds potentially ‘sensitive’ information? I can protect the pages at the template level easily enough, but it would be nice to allow it to use SSL as well. I suppose I could define a new constant or variable (i.e. ‘https://www.mysite.com’), and then change all instances of {path:wiki_home} to that variable in the default.php file for my Wiki theme?

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 30 July 2008 09:03 PM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

Just a question regarding my last paragraph there: is making a new constant something I can/should do to get the Wiki to auto-generate secure URLs? I just want a secure Wiki. I may consider another Wiki (what one, I don’t know) as long as it will let me secure it!

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120481 Total Logged-in Users: 49
Total Topics: 126554 Total Anonymous Users: 24
Total Replies: 665405 Total Guests: 266
Total Posts: 791959    
Members ( View Memberlist )