-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.htaccess
87 lines (67 loc) · 2.65 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# https://stackoverflow.com/questions/25423141/what-exactly-does-the-the-multiviews-options-in-htaccess
#<IfModule mod_negotiation.c>
# Options -MultiViews
#</IfModule>
# redirect "/index.php?id=xxx" to "/index/xxx"
#RewriteCond %{THE_REQUEST} \s/index\.php\?page=([0-9]+)\s [NC]
#RewriteRule ^ /section/%1? [R=301,L]
# internally rewrite "/section/xxx" to "/section.php?id=xxx"
#RewriteRule ^index/([0-9]+)$ /index.php?page=$1 [L]
#RewriteBase /
# only if file not exists
#RewriteCond %{REQUEST_FILENAME} !-f
# only, if directory not exists
#RewriteCond %{REQUEST_FILENAME} !-d
# rewrite all urls
#RewriteRule (.*)/$ index.php?&page=$1
#RewriteRule ^/([^/]+)$ /index.php?id=$1 [L]
#Reduce Server HTTP Header to the minimum product (Apache) rather than showing detailed version information of the server and operating system
#ServerTokens Prod
#Remove the footer from error pages, which details the version numbers:
#ServerSignature Off
<IfModule mod_headers.c>
RequestHeader unset X-Powered-By
Header unset X-Powered-By
RequestHeader unset Server
Header unset Server
Header always unset "X-Powered-By"
Header always unset "Server"
</IfModule>
<IfModule mod_headers.c>
Header unset Server
Header always unset X-Powered-By
Header unset X-Powered-By
Header unset X-CF-Powered-By
Header unset X-Mod-Pagespeed
Header unset X-Pingback
</IfModule>
# use gzip compression
AddOutputFilterByType DEFLATE text/html text/plain text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/xml
#<IfModule mod_expires.c>
# ExpiresActive On
# ExpiresDefault "access plus 1 seconds"
# ExpiresByType text/html "access plus 1 seconds"
# ExpiresByType image/x-icon "access plus 2592000 seconds"
# ExpiresByType image/gif "access plus 2592000 seconds"
# ExpiresByType image/jpeg "access plus 2592000 seconds"
# ExpiresByType image/png "access plus 2592000 seconds"
#</IfModule>
#<FilesMatch "\.(?i:gif|jpe?g|png|ico|css|js|swf)$">
# <IfModule mod_headers.c>
# Header set Cache-Control "max-age=172800, public, must-revalidate"
# </IfModule>
#</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#http://foobarblog.net/blog/seo-suchmaschinenfreundliche-urls-durch-rewriten-in-der-htaccess-datei-21/
RewriteCond %{QUERY_STRING} ^(.*)$
#https://haensel.pro/php/mit-htaccess-und-php-einfach-friendly-urls-nutzen
RewriteRule ^(.*)$ index.php?page=$1&%1 [L]
</IfModule>