My personal blog. https://blog.airikr.me
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

255 lines
9.9 KiB

SetEnv SERVER_ADMIN hi@airikr.me
SetEnv TZ Europe/Stockholm
DefaultLanguage sv-SE
AddDefaultCharset UTF-8
Options All -Indexes
IndexIgnore *
LimitRequestBody 20971520
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</ifModule>
<Files .htaccess>
order allow,deny
deny from all
</Files>
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>
<IfModule mod_expires.c>
<filesMatch ".(ico|jpg|png|js|css)$">
Header set Cache-Control "max-age=84600, public"
</filesMatch>
</IfModule>
<IfModule mod_rewrite.c>
DirectoryIndex index.php /airikr-blog/index.php
ErrorDocument 404 /airikr-blog/error.php?err=404
RewriteEngine On
RewriteBase /airikr-blog/
RewriteCond %{REQUEST_METHOD} !^(GET|POST)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# List posts
RewriteRule ^$ index.php
RewriteRule ^en$ index.php?lau=en
RewriteRule ^page:([0-9]{1,4})$ index.php?pgn=$1
RewriteRule ^en/page:([0-9]{1,4})$ index.php?pgn=$1&lau=en
RewriteRule ^tag:([a-z-åäö0-9]+)$ index.php?pag=tag&tag=$1
RewriteRule ^en/tag:([a-z-åäö0-9]+)$ index.php?pag=tag&tag=$1&lau=en
RewriteRule ^tag:([a-z-åäö0-9]+)/page:([0-9]{1,4})$ index.php?pag=tag&tag=$1&pgn=$2
RewriteRule ^en/tag:([a-z-åäö0-9]+)/page:([0-9]{1,4})$ index.php?pag=tag&tag=$1&pgn=$2&lau=en
RewriteRule ^search:([a-z-åäö0-9]+)$ index.php?pag=search&str=$1
RewriteRule ^en/search:([a-z-åäö0-9]+)$ index.php?pag=search&str=$1&lau=en
RewriteRule ^search:([a-z-åäö0-9]+)/page:([0-9]{1,4})$ index.php?pag=search&str=$1&pgn=$2
RewriteRule ^en/search:([a-z-åäö0-9]+)/page:([0-9]{1,4})$ index.php?pag=search&str=$1&pgn=$2&lau=en
# Post
RewriteRule ^read:([a-z0-9]{13})$ page-read.php?idp=$1
RewriteRule ^en/read:([a-z0-9]{13})$ page-read.php?idp=$1&lau=en
RewriteRule ^read:([a-z0-9]{13})/edit$ page-editpost.php?idp=$1
RewriteRule ^en/read:([a-z0-9]{13})/edit$ page-editpost.php?idp=$1&lau=en
RewriteRule ^read:([a-z0-9]{13})/share:mastodon$ page-read.php?idp=$1&shr=chooseinstance
RewriteRule ^en/read:([a-z0-9]{13})/share:mastodon$ page-read.php?idp=$1&lau=en&shr=chooseinstance
RewriteRule ^read:([a-z0-9]{13})/share-to-mastodon$ page-read.php?idp=$1
RewriteRule ^en/read:([a-z0-9]{13})/share-to-mastodon$ page-read.php?idp=$1&lau=en
RewriteRule ^read:([a-z0-9]{13})/(send|save)-comment$ page-read.php?idp=$1
RewriteRule ^en/read:([a-z0-9]{13})/(send|save)-comment$ page-read.php?idp=$1&lau=en
RewriteRule ^edit:([a-z0-9]{13})$ admin-write.php?idp=$1
RewriteRule ^en/edit:([a-z0-9]{13})$ admin-write.php?idp=$1&lau=en
RewriteRule ^publish:([a-z0-9]{13})$ admin-publish.php?idp=$1
RewriteRule ^en/publish:([a-z0-9]{13})$ admin-publish.php?idp=$1&lau=en
RewriteRule ^random-post$ page-randompost.php
RewriteRule ^random-post/current:([a-z0-9]{13})$ page-randompost.php?idp=$1
RewriteRule ^en/random-post$ page-randompost.php?lau=en
RewriteRule ^en/random-post/current:([a-z0-9]{13})$ page-randompost.php?idp=$1&lau=en
RewriteRule ^diff:([a-z0-9]{13})$ page-post-diff.php?idp=$1
RewriteRule ^diff:([a-z0-9]{13})/([0-9]{10})$ page-post-diff.php?idp=$1&tms=$2
RewriteRule ^diff:([a-z0-9]{13})/([0-9]{10})/(accept|deny)$ page-post-diff.php?idp=$1&tms=$2&opt=$3
RewriteRule ^en/diff:([a-z0-9]{13})$ page-post-diff.php?idp=$1&lau=en
RewriteRule ^en/diff:([a-z0-9]{13})/([0-9]{10})$ page-post-diff.php?idp=$1&tms=$2&lau=en
RewriteRule ^en/diff:([a-z0-9]{13})/([0-9]{10})/(accept|deny)$ page-post-diff.php?idp=$1&tms=$2&opt=$3&lau=en
# Comment
RewriteRule ^read:([a-z0-9]{13})/manage-comment:([0-9]+)$ page-read.php?idp=$1&mge=$2
RewriteRule ^en/read:([a-z0-9]{13})/manage-comment:([0-9]+)$ page-read.php?idp=$1&mge=$2&lau=en
RewriteRule ^read:([a-z0-9]{13})/manage-comment:([0-9]+)/error:(invalid-email|invalid-url|wrong-password)$ page-read.php?idp=$1&mge=$2&err=$3
RewriteRule ^en/read:([a-z0-9]{13})/manage-comment:([0-9]+)/error:(invalid-email|invalid-url|wrong-password)$ page-read.php?idp=$1&mge=$2&err=$3&lau=en
RewriteRule ^comment-author:([a-z0-9-]+)$ page-comment-author.php?ide=$1
RewriteRule ^en/comment-author:([a-z0-9-]+)$ page-comment-author.php?ide=$1&lau=en
# Pages
RewriteRule ^search$ page-search.php?pag=$1
RewriteRule ^en/search$ page-search.php?lau=en
RewriteRule ^statistics$ page-statistics.php
RewriteRule ^en/statistics$ page-statistics.php?lau=en
RewriteRule ^privacy$ page-privacy.php
RewriteRule ^en/privacy$ page-privacy.php?lau=en
RewriteRule ^copyright$ page-copyright.php
RewriteRule ^en/copyright$ page-copyright.php?lau=en
RewriteRule ^rss-feed$ page-feed.php
RewriteRule ^en/rss-feed$ page-feed.php?lau=en
RewriteRule ^comments$ page-comments.php
RewriteRule ^en/comments$ page-comments.php?lau=en
# User
RewriteRule ^settings$ admin-settings.php
RewriteRule ^en/settings$ admin-settings.php?lau=en
# Food habits
RewriteRule ^food-habits$ page-food-habits.php
RewriteRule ^en/food-habits$ page-food-habits.php?lau=en
# Admin
RewriteRule ^new-post$ admin-write.php
RewriteRule ^en/new-post$ admin-write.php?lau=en
RewriteRule ^delete:([a-z0-9]{13})$ admin-write.php?del=$1
RewriteRule ^en/delete:([a-z0-9]{13})$ admin-write.php?del=$1&lau=en
RewriteRule ^delete:([a-z0-9]{13})/cover:([a-z0-9]{32})$ admin-write.php?del=$1&cov=$2
RewriteRule ^en/delete:([a-z0-9]{13})/cover:([a-z0-9]{32})$ admin-write.php?del=$1&cov=$2&lau=en
RewriteRule ^files$ admin-files.php
RewriteRule ^en/files$ admin-files.php?lau=en
RewriteRule ^files/delete:([0-9]+)$ admin-files.php?idf=$1&del=
RewriteRule ^en/files/delete:([0-9]+)$ admin-files.php?idf=$1&del&lau=en
RewriteRule ^files/edit:([a-z0-9]+)$ admin-files.php?idf=$1
RewriteRule ^en/files/edit:([a-z0-9]+)$ admin-files.php?idf=$1&lau=en
RewriteRule ^saved-posts$ index.php?pag=saved
RewriteRule ^en/saved-posts$ index.php?pag=saved&lau=en
RewriteRule ^login$ admin-login.php
RewriteRule ^en/login$ admin-login.php?lau=en
RewriteRule ^logout$ admin-logout.php
RewriteRule ^en/logout$ admin-logout.php?lau=en
RewriteRule ^settings$ admin-settings.php
RewriteRule ^en/settings$ admin-settings.php?lau=en
RewriteRule ^verify-totp$ admin-adduser.php?ver=
RewriteRule ^en/verify-totp$ admin-adduser.php?ver&lau=en
RewriteRule ^adduser$ admin-adduser.php
RewriteRule ^en/adduser$ admin-adduser.php?lau=en
# RewriteRule ^reset-totp$ admin-totp-reset.php
# RewriteRule ^en/reset-totp$ admin-totp-reset.php?lau=en
RewriteRule ^publish$ admin-publish.php
RewriteRule ^en/publish$ admin-publish.php?lau=en
RewriteRule ^publish/post:([a-z0-9]{13})$ admin-publish.php?idp=$1
RewriteRule ^en/publish/post:([a-z0-9]{13})$ admin-publish.php?idp=$1&lau=en
RewriteRule ^settings:setup-totp$ admin-setup-totp.php
RewriteRule ^en/settings:setup-totp$ admin-setup-totp.php?lau=en
RewriteRule ^settings:setup-totp/go$ ajax/settings-setup-totp.php
RewriteRule ^comment-send/post:([a-z0-9]{13})$ ajax/comment-send.php?idp=$1
RewriteRule ^comment-save/post:([a-z0-9]{13})/comment:([0-9]+)$ ajax/comment-save.php?idp=$1&idc=$2
RewriteRule ^admin:upload-file$ ajax/admin-file-upload.php
RewriteRule ^admin/edit-file:([0-9]+)$ ajax/admin-file-edit.php?idf=$1
RewriteRule ^admin:post-publish$ ajax/admin-post.php?typ=publish
RewriteRule ^admin:post-finish:([a-z0-9]{13})$ ajax/admin-post.php?idp=$1&typ=finish
RewriteRule ^admin:post-save$ ajax/admin-post.php?typ=savenew
RewriteRule ^admin:post-save:([a-z0-9]{13})$ ajax/admin-post.php?idp=$1&typ=save
RewriteRule ^admin:post-edit:([a-z0-9]{13})$ ajax/admin-post.php?idp=$1&typ=edit
RewriteRule ^user:save-settings$ ajax/save-settings.php
RewriteRule ^send-edit$ ajax/public-edit.php
# Other
RewriteRule ^do-search$ page-search.php?go=
RewriteRule ^en/do-search$ page-search.php?go&lau=en
RewriteRule ^load:posts$ ajax/list-posts.php
RewriteRule ^load:posts/page:([0-9]{1,4})$ ajax/list-posts.php?pgn=$1
RewriteRule ^load:posts/tag:([a-z-åäö0-9]+)/page:([0-9]{1,4})$ ajax/list-posts.php?tag=$1&pgn=$2
RewriteRule ^load:posts/search:([a-z-åäö0-9]+)/page:([0-9]{1,4})$ ajax/list-posts.php?str=$1&pgn=$2
RewriteRule ^load:posts/page:saved$ ajax/list-posts.php?pag=saved
RewriteRule ^en/load:posts$ ajax/list-posts.php?lau=en
RewriteRule ^en/load:posts/page:([0-9]{1,4})$ ajax/list-posts.php?pgn=$1&lau=en
RewriteRule ^en/load:posts/tag:([a-z-åäö0-9]+)/page:([0-9]{1,4})$ ajax/list-posts.php?tag=$1&pgn=$2&lau=en
RewriteRule ^en/load:posts/search:([a-z-åäö0-9]+)/page:([0-9]{1,4})$ ajax/list-posts.php?str=$1&pgn=$2&lau=en
RewriteRule ^en/load:posts/page:saved$ ajax/list-posts.php?pag=saved&lau=en
RewriteRule ^admin:login$ ajax/admin-login.php
# RewriteRule ^admin:restore$ ajax/admin-restore.php
RewriteRule ^feed:xml$ rss.xml
RewriteRule ^en/feed:xml$ rss-en.xml
RewriteRule ^feed:json$ rss.json
RewriteRule ^en/feed:json$ rss-en.json
RewriteRule ^cover:([a-z0-9]{32})$ covers/$1.jpg
RewriteRule ^image:([a-z0-9.]{32,40})$ images/uploaded/small/$1
RewriteRule ^large-image:([a-z0-9.]{32,40})$ images/uploaded/large/$1
RewriteRule ^avatar:(.*)$ get-avatar.php?str=$1
RewriteRule ^minify$ minify-files.php
RewriteRule ^list-comments/post-id:([0-9]+)$ ajax/list-comments.php?idp=$1
RewriteRule ^en/list-comments/post-id:([0-9]+)$ ajax/list-comments.php?idp=$1&lau=en
RewriteRule ^manage-comment/comment-id:([0-9]+)$ ajax/manage-comment.php?idc=$1
</IfModule>