Not logged in. · Lost password · Register
Forum: General Help and Support Server Setup RSS
Dokuwiki on https
Avatar
karnhack #1
Member since Apr 2018 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: Dokuwiki on https
Hi,
my website karnhack.com works on wordpress. In a subdirectory I have the dokuwiki karnhack.com/wiki.
The problem is that dokuwiki is not under https, how can I force this? I tried to edit the file .htaccess but wordpress stops working...
My .htaccess contains this code necessary for wordpress operation ... how can I add https without doing damage? :

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Thanks

Gianluca
Avatar
dinsdale #2
Member since Oct 2016 · 47 posts
Group memberships: Members
Show profile · Link to this post
Hi,

I'm using this scheme to ensure HTTPS:


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
Avatar
karnhack #3
Member since Apr 2018 · 3 posts
Group memberships: Members
Show profile · Link to this post
to be replaced entirely by that of wordpress?
Avatar
dinsdale #4
Member since Oct 2016 · 47 posts
Group memberships: Members
Show profile · Link to this post
I don't know whether that would work, I'm not a wordpress expert. You may prepend it like this:


 
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

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

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

But I'm not sure whether this will break somethink. You may generate a virtual host for the wiki instance, so you can apply the settings only for the wiki.
Avatar
karnhack #5
Member since Apr 2018 · 3 posts
Group memberships: Members
Show profile · Link to this post
Thanks for your helps... i have solved with this code:
# BEGIN HTTPS
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_HOST} ^www.
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
# END HTTPS

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-03-23, 22:18:27 (UTC +01:00)