1212# @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
1313# @link https://www.phpmyfaq.de
1414# @since 2004-11-13
15-
1615DirectoryIndex index.php
17-
1816# always follow the symlinks
1917<IfModule mod_negotiation.c >
2018 Options +FollowSymlinks -MultiViews -Indexes
2119</IfModule >
22-
2320# X-Frame-Options to prevent clickjacking
2421Header always append X-Frame-Options SAMEORIGIN
25-
2622# CORS
2723Header set Access-Control-Allow -Origin "*"
2824Header set Access-Control-Allow -Methods "GET,PUT,POST,DELETE"
2925Header set Access-Control-Allow -Headers "Content-Type, Authorization"
30-
3126# Set cache control
3227<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
3328 Header set Cache-Control "max-age=84600 , no-store"
3429 Header set Pragma "no-cache"
3530</filesMatch>
36-
3731# Set Gzip compression
3832<IfModule mod_deflate.c >
3933 AddOutputFilterByType DEFLATE application/javascript
@@ -59,130 +53,98 @@ Header set Access-Control-Allow-Headers "Content-Type, Authorization"
5953 AddOutputFilterByType DEFLATE text/plain
6054 AddOutputFilterByType DEFLATE text/xml
6155</IfModule >
62-
6356# Enable Expires headers to set expiration dates for various file types
6457<IfModule mod_expires.c >
65- ExpiresActive On
66-
67- # Set expiration for image files to 1 year
68- ExpiresByType image/jpeg "access plus 1 year"
69- ExpiresByType image/gif "access plus 1 year"
70- ExpiresByType image/png "access plus 1 year"
71- ExpiresByType image/webp "access plus 1 year"
72- ExpiresByType image/svg+xml "access plus 1 year"
73- ExpiresByType image/x-icon "access plus 1 year"
74-
75- # Set expiration for video files to 1 year
76- ExpiresByType video/webm "access plus 1 year"
77- ExpiresByType video/mp4 "access plus 1 year"
78- ExpiresByType video/mpeg "access plus 1 year"
79-
80- # Set expiration for font files to 1 year
81- ExpiresByType font/ttf "access plus 1 year"
82- ExpiresByType font/otf "access plus 1 year"
83- ExpiresByType font/woff "access plus 1 year"
84- ExpiresByType font/woff2 "access plus 1 year"
85- ExpiresByType application/font-woff "access plus 1 year"
86- ExpiresByType application/font-woff2 "access plus 1 year"
87-
88- # Set expiration for CSS and JavaScript files to 1 year
89- ExpiresByType text/css "access plus 1 year"
90- ExpiresByType text/javascript "access plus 1 year"
91- ExpiresByType application/javascript "access plus 1 year"
92-
93- # Set expiration for other file types to 1 year
94- ExpiresByType application/pdf "access plus 1 year"
95- ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
58+ ExpiresActive On
59+ # Set expiration for image files to 1 year
60+ ExpiresByType image/jpeg "access plus 1 year"
61+ ExpiresByType image/gif "access plus 1 year"
62+ ExpiresByType image/png "access plus 1 year"
63+ ExpiresByType image/webp "access plus 1 year"
64+ ExpiresByType image/svg+xml "access plus 1 year"
65+ ExpiresByType image/x-icon "access plus 1 year"
66+ # Set expiration for video files to 1 year
67+ ExpiresByType video/webm "access plus 1 year"
68+ ExpiresByType video/mp4 "access plus 1 year"
69+ ExpiresByType video/mpeg "access plus 1 year"
70+ # Set expiration for font files to 1 year
71+ ExpiresByType font/ttf "access plus 1 year"
72+ ExpiresByType font/otf "access plus 1 year"
73+ ExpiresByType font/woff "access plus 1 year"
74+ ExpiresByType font/woff2 "access plus 1 year"
75+ ExpiresByType application/font-woff "access plus 1 year"
76+ ExpiresByType application/font-woff2 "access plus 1 year"
77+ # Set expiration for CSS and JavaScript files to 1 year
78+ ExpiresByType text/css "access plus 1 year"
79+ ExpiresByType text/javascript "access plus 1 year"
80+ ExpiresByType application/javascript "access plus 1 year"
81+ # Set expiration for other file types to 1 year
82+ ExpiresByType application/pdf "access plus 1 year"
83+ ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
9684</IfModule >
97-
9885# Enable Cache-Control headers to set caching policies for various file types
9986<IfModule mod_headers.c >
100- <FilesMatch "\.(flv|gif|ico|jpg|jpeg|mp4|mpeg|png|svg|swf|webp|webm|js|pdf|css|woff|woff2)$" >
101- Header set Cache-Control "max-age=31536000 , public"
102- </FilesMatch >
87+ <FilesMatch "\.(flv|gif|ico|jpg|jpeg|mp4|mpeg|png|svg|swf|webp|webm|js|pdf|css|woff|woff2)$" >
88+ Header set Cache-Control "max-age=31536000 , public"
89+ </FilesMatch >
10390</IfModule >
104-
105-
10691# Set mod_rewrite
10792<IfModule mod_rewrite.c >
10893 # This has to be 'On'
10994 RewriteEngine On
110-
11195 <IfModule mod_fcgid.c >
11296 RewriteCond %{HTTP:Authorization} .
11397 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization }]
11498 </IfModule >
115-
11699 # the path to your phpMyFAQ installation
117- RewriteBase /
118-
100+ RewriteBase //localhost/phpmyfaq-test/./phpmyfaq/src/libs/bin/phpunit/
119101 # Error pages
120102 ErrorDocument 404 /index.php?action=404
121-
122103 # General pages
123104 RewriteRule add-faq.html$ index.php?action=add [L,QSA]
124105 RewriteRule add-question.html$ index.php?action=ask [L,QSA]
125106 RewriteRule show-categories.html$ index.php?action=show [L,QSA]
126107 RewriteRule ^(search|open-questions|contact|glossary|overview|login|privacy)\.html$ index.php?action=$1 [L,QSA]
127108 RewriteRule ^(login) index.php?action=login [L,QSA]
128-
129109 # start page
130110 RewriteRule ^index.html$ index.php [PT]
131-
132111 # a solution ID page
133112 RewriteCond %{REQUEST_URI} solution_id_([0-9]+)\.html$ [NC]
134113 RewriteRule ^solution_id_(.*)\.html$ index.php?solution_id=$1 [L,QSA]
135-
136114 # the bookmarks page
137115 RewriteRule ^bookmarks\.html$ index.php?action=bookmarks [L,QSA]
138-
139116 # phpMyFAQ faq record page
140117 RewriteRule ^content/([0-9]+)/([0-9]+)/([a-z\-]+)/(.+)\.htm(l?)$ index.php?action=faq&cat=$1&id=$2&artlang=$3 [L,QSA]
141-
142118 # phpMyFAQ category page with page count
143119 RewriteRule ^category/([0-9]+)/([0-9]+)/(.+)\.htm(l?)$ index.php?action=show&cat=$1&seite=$2 [L,QSA]
144-
145120 # phpMyFAQ category page
146121 RewriteRule ^category/([0-9]+)/(.+)\.htm(l?)$ index.php?action=show&cat=$1 [L,QSA]
147-
148122 # phpMyFAQ news page
149123 RewriteRule ^news/([0-9]+)/([a-z\-]+)/(.+)\.htm(l?)$ index.php?action=news&newsid=$1&newslang=$2 [L,QSA]
150-
151124 # phpMyFAQ sitemap
152125 RewriteRule ^sitemap/([^\/]+)/([a-z\-]+)\.htm(l?)$ index.php?action=sitemap&letter=$1&lang=$2 [L,QSA]
153-
154126 # phpMyFAQ Google sitemap
155127 RewriteRule ^sitemap.xml$ sitemap.xml.php [L]
156128 RewriteRule ^sitemap.gz$ sitemap.xml.php?gz=1 [L]
157129 RewriteRule ^sitemap.xml.gz$ sitemap.xml.php?gz=1 [L]
158-
159130 # phpMyFAQ tags page with page count
160131 RewriteRule ^tags/([0-9]+)/([0-9]+)/(.+)\.htm(l?)$ index.php?action=search&tagging_id=$1&seite=$2 [L,QSA]
161-
162132 # phpMyFAQ tags page
163133 RewriteRule ^tags/([0-9]+)/([^\/]+)\.htm(l?)$ index.php?action=search&tagging_id=$1 [L,QSA]
164-
165134 # Authentication services
166135 RewriteRule ^services/webauthn(.*) services/webauthn/index.php [L,QSA]
167-
168136 # User pages
169137 RewriteRule ^user/(ucp|bookmarks|request-removal|logout|register) index.php?action=$1 [L,QSA]
170-
171138 # Setup and update pages
172139 RewriteRule ^setup/(.*) setup/index.php [L,QSA]
173140 RewriteRule ^update/(.*) update/index.php [L,QSA]
174-
175141 # Administration API
176142 RewriteRule ^admin/api/(.*) admin/api/index.php [L,QSA]
177-
178143 # Private APIs
179144 RewriteRule ^api/(autocomplete|bookmark/delete|bookmark/create|user/data/update|user/password/update|user/request-removal|user/remove-twofactor|contact|voting|register|captcha|share|comment/create|faq/create|question/create|webauthn/prepare|webauthn/register|webauthn/prepare-login|webauthn/login) api/index.php [L,QSA]
180-
181145 # Setup APIs
182146 RewriteRule ^api/setup/(check|backup|update-database) api/index.php [L,QSA]
183-
184147 # REST API v3.0 and v3.1
185148 # * http://[...]/api/v3.x/<ACTION>
186149 RewriteRule ^api/v3\.[01]/(.*) api/index.php [L,QSA]
187-
188150</IfModule >
0 commit comments