Skip to content

Commit

Permalink
Add the htaccess file
Browse files Browse the repository at this point in the history
  • Loading branch information
lexisother committed Jun 5, 2023
1 parent b18022c commit a16d10f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ COPY --from=preparer /tmp/NativeSvgHandler extensions/NativeSvgHandler
COPY --from=preparer /tmp/CodeMirror extensions/CodeMirror
COPY --from=preparer /tmp/TemplateStyles extensions/TemplateStyles
COPY composer.local.json .
COPY htaccess .htaccess

RUN composer update

Expand Down
24 changes: 24 additions & 0 deletions htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
RewriteEngine on

# Verifying if user forgot to put trailling slash. If so, we'll rewrite to Main_Page
RewriteRule ^(.*) /index.php?tile=Main_Page [L]

# Don't rewrite requests for files in MediaWiki subdirectories,
# MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
#RewriteCond %{REQUEST_URI} !^/sys/
RewriteCond %{REQUEST_URI} !^/load.php
RewriteCond %{REQUEST_URI} !^/api.php
RewriteCond %{REQUEST_URI} !^/images/
RewriteCond %{REQUEST_URI} !^/skins/
RewriteCond %{REQUEST_URI} !^/stylesheets/
RewriteCond %{REQUEST_URI} !^/resources/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteCond %{REQUEST_URI} !^/robots.txt
#RewriteCond %{REQUEST_URI} !^/mw-config/

# Make sure there is no query string (Unless user is making a search)
RewriteCond %{QUERY_STRING} ^$ [OR] RewriteCond %{REQUEST_URI} ^/Special:Search

RewriteRule ^(.*) /index.php/$1 [L]

0 comments on commit a16d10f

Please sign in to comment.