Skip to content

Commit

Permalink
Merge pull request #172 from leomoon/master
Browse files Browse the repository at this point in the history
fix stop direct md access when wikidocs is not installed at root
  • Loading branch information
leomoon authored Aug 24, 2024
2 parents ec4c58d + fdd97a2 commit 3d1ea9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.44
1.0.45
14 changes: 8 additions & 6 deletions sample.htaccess
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?doc=$1 [NC,L,QSA]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} \.md$ [NC]
RewriteRule ^.*$ / [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?doc=$1 [NC,L,QSA]
</IfModule>
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
$htaccess.="\tRewriteEngine On\n";
$htaccess.="\tRewriteBase ".$_SESSION['wikidocs']['setup']['path']."\n";
$htaccess.="\tRewriteCond %{REQUEST_URI} \.md$ [NC]\n";
$htaccess.="\tRewriteRule ^.*$ / [R=301,L]\n";
$htaccess.="\tRewriteRule ^.*$ ".$_SESSION['wikidocs']['setup']['path']." [R=301,L]\n";
$htaccess.="\tRewriteCond %{REQUEST_FILENAME} !-f\n";
$htaccess.="\tRewriteRule ^(.*)$ index.php?doc=$1 [NC,L,QSA]\n";
$htaccess.="</IfModule>\n";
Expand Down

0 comments on commit 3d1ea9b

Please sign in to comment.