/
.htaccess
39 lines (32 loc) · 1.46 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
DirectoryIndex homepage.php
# One year for image files
<filesMatch ".(jpg|jpeg|png|gif|ico|eot|woff2|woff|ttf|svg|js|webp)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>
# One month for css and js
<filesMatch ".(css|js)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
ErrorDocument 404 /404.php
RedirectMatch 301 ^/facebook$ https://www.facebook.com/ChenPanXYZ
RedirectMatch 301 ^/instagram$ https://www.instagram.com/ChenPanXYZ
RedirectMatch 301 ^/twitter$ https://www.twitter.com/ChenPanXYZ
RedirectMatch 301 ^/github$ https://www.github.com/ChenPanXYZ
RedirectMatch 301 ^/linkedin$ https://www.linkedin.com/in/ChenPanXYZ
RedirectMatch 301 ^/weibo$ https://www.weibo.com/ChenPanXYZ
RedirectMatch 301 ^/game/snake$ https://projects.chenpan.xyz/snake
RedirectMatch 301 ^/game/snake/$ https://projects.chenpan.xyz/snake
RedirectMatch 301 ^/snake$ https://projects.chenpan.xyz/snake
RedirectMatch 301 ^/snake/$ https://projects.chenpan.xyz/snake
RedirectMatch 301 ^/github/website$ https://github.com/ChenPanXYZ/lavandula
Redirect permanent /github http://www.github.com/chenpanxyz
RewriteBase /
Redirect permanent /blog https://blog.chenpan.xyz/
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Modpagespeed on
Redirect 301 /csc309/ https://courses.chenpan.xyz/csc309/chenpan/