.htaccess 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On
  3. RewriteCond %{HTTP_HOST} ^www\.(.+?)$
  4. RewriteRule ^(.*)$ https://$1 [R=301,L]
  5. # Main
  6. RewriteBase /
  7. RewriteRule ^home/?$ / [R=301]
  8. RewriteBase /intent
  9. RewriteRule ^intent/toot/?$ share\.php [NC,L]
  10. RewriteBase /login
  11. RewriteRule ^login/?$ login/login\.php [NC,L,QSA]
  12. RewriteRule ^auth/?$ login/auth\.php [NC,L,QSA]
  13. RewriteRule ^logout/?$ login/logout\.php [NC,L,QSA]
  14. RewriteRule ^terms/?$ login/terms\.php [NC,L,QSA]
  15. RewriteRule ^privacy/?$ login/privacy\.php [NC,L,QSA]
  16. RewriteRule ^imprint/?$ login/imprint\.php [NC,L,QSA]
  17. # LTL
  18. RewriteBase /local
  19. RewriteRule ^local/?$ local\.php [NC,L]
  20. # FTL
  21. RewriteBase /federated
  22. RewriteRule ^federated/?$ federated\.php [NC,L]
  23. # Notice
  24. RewriteBase /notifications
  25. RewriteRule ^notifications/?$ notifications\.php [NC,L]
  26. # Who to follow
  27. RewriteBase /whotofollow
  28. RewriteRule ^whotofollow/?$ who_to_follow\.php [NC,L]
  29. # Direct
  30. RewriteBase /direct
  31. RewriteRule ^direct/?$ direct\.php [NC,L]
  32. # Instance
  33. RewriteBase /instance
  34. RewriteRule ^instance/?$ instance\.php [NC,L]
  35. # Lists
  36. RewriteBase /lists
  37. RewriteRule ^lists/?$ lists\.php [NC,L]
  38. RewriteRule ^lists/(\d+)/?$ lists_view\.php?id=$1 [NC,L,QSA]
  39. RewriteRule ^lists/(\d+)/add/?$ lists_add\.php?id=$1 [NC,L,QSA]
  40. # Search
  41. RewriteBase /search
  42. RewriteRule ^search/?$ search_hash_tag\.php [NC,L,QSA]
  43. RewriteRule ^search/users/?$ search_user\.php [NC,L,QSA]
  44. # Settings
  45. RewriteBase /settings
  46. RewriteRule ^settings/?$ settings_general\.php [NC,L]
  47. RewriteRule ^settings/profile/?$ settings_profile\.php [NC,L]
  48. RewriteRule ^settings/appearance/?$ settings_appearance\.php [NC,L]
  49. RewriteRule ^settings/filters/?$ settings_filters\.php [NC,L]
  50. RewriteRule ^settings/media/?$ settings_media\.php [NC,L]
  51. RewriteRule ^settings/followers/?$ settings_accounts\.php [NC,L]
  52. RewriteRule ^settings/mutes/?$ settings_accounts\.php [NC,L]
  53. RewriteRule ^settings/blocks/?$ settings_accounts\.php [NC,L]
  54. # User
  55. RewriteBase /
  56. RewriteRule ^@(.+)@(.+)\.([a-z]+)/?$ user\.php?user=@$1@$2\.$3 [NC,L,QSA]
  57. RewriteRule ^@(.+)@(.+)\.([a-z]+)/status/(.+?)?$ user\.php?user=@$1@$2\.$3&status=$4 [NC,L,QSA]
  58. RewriteRule ^@(.+)@(.+)\.([a-z]+)/media/?$ user_only_media\.php?user=@$1@$2\.$3 [NC,L,QSA]
  59. RewriteRule ^@(.+)@(.+)\.([a-z]+)/with_replies/?$ user_include_replies\.php?user=@$1@$2\.$3 [NC,L,QSA]
  60. RewriteRule ^@(.+)@(.+)\.([a-z]+)/followers/?$ user_followers\.php?user=@$1@$2\.$3 [NC,L,QSA]
  61. RewriteRule ^@(.+)@(.+)\.([a-z]+)/following/?$ user_following\.php?user=@$1@$2\.$3 [NC,L,QSA]
  62. RewriteRule ^@(.+)@(.+)\.([a-z]+)/favourites/?$ user_favorite\.php?user=@$1@$2\.$3 [NC,L,QSA]
  63. # Image
  64. RewriteBase /
  65. RewriteRule ^avatars/original/missing\.png$ assets/images/missing\.png [NC,L]
  66. RewriteRule ^headers/original/missing\.png$ assets/images/missing_header\.png [NC,L]
  67. # 404
  68. RewriteRule ^404/?$ 404\.php [NC,L,QSA]
  69. ErrorDocument 404 /404
  70. </IfModule>