.htaccess 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. # Bookmarks
  27. RewriteBase /bookmarks
  28. RewriteRule ^bookmarks/?$ bookmarks\.php [NC,L]
  29. # Who to follow
  30. RewriteBase /whotofollow
  31. RewriteRule ^whotofollow/?$ who_to_follow\.php [NC,L]
  32. # Direct
  33. RewriteBase /direct
  34. RewriteRule ^direct/?$ direct\.php [NC,L]
  35. # Instance
  36. RewriteBase /instance
  37. RewriteRule ^instance/?$ instance\.php [NC,L]
  38. # Lists
  39. RewriteBase /lists
  40. RewriteRule ^lists/?$ lists\.php [NC,L]
  41. RewriteRule ^lists/(\d+)/?$ lists_view\.php?id=$1 [NC,L,QSA]
  42. RewriteRule ^lists/(\d+)/add/?$ lists_add\.php?id=$1 [NC,L,QSA]
  43. # Search
  44. RewriteBase /search
  45. RewriteRule ^search/?$ search_hash_tag\.php [NC,L,QSA]
  46. RewriteRule ^search/users/?$ search_user\.php [NC,L,QSA]
  47. # Settings
  48. RewriteBase /settings
  49. RewriteRule ^settings/?$ settings_general\.php [NC,L]
  50. RewriteRule ^settings/profile/?$ settings_profile\.php [NC,L]
  51. RewriteRule ^settings/appearance/?$ settings_appearance\.php [NC,L]
  52. RewriteRule ^settings/filters/?$ settings_filters\.php [NC,L]
  53. RewriteRule ^settings/media/?$ settings_media\.php [NC,L]
  54. RewriteRule ^settings/followers/?$ settings_accounts\.php [NC,L]
  55. RewriteRule ^settings/mutes/?$ settings_accounts\.php [NC,L]
  56. RewriteRule ^settings/blocks/?$ settings_accounts\.php [NC,L]
  57. # User
  58. RewriteBase /
  59. RewriteRule ^@(.+)@(.+)\.([a-z]+)/?$ user\.php?user=@$1@$2\.$3 [NC,L,QSA]
  60. RewriteRule ^@(.+)@(.+)\.([a-z]+)/status/(.+?)?$ user\.php?user=@$1@$2\.$3&status=$4 [NC,L,QSA]
  61. RewriteRule ^@(.+)@(.+)\.([a-z]+)/media/?$ user_only_media\.php?user=@$1@$2\.$3 [NC,L,QSA]
  62. RewriteRule ^@(.+)@(.+)\.([a-z]+)/with_replies/?$ user_include_replies\.php?user=@$1@$2\.$3 [NC,L,QSA]
  63. RewriteRule ^@(.+)@(.+)\.([a-z]+)/followers/?$ user_followers\.php?user=@$1@$2\.$3 [NC,L,QSA]
  64. RewriteRule ^@(.+)@(.+)\.([a-z]+)/following/?$ user_following\.php?user=@$1@$2\.$3 [NC,L,QSA]
  65. RewriteRule ^@(.+)@(.+)\.([a-z]+)/favourites/?$ user_favorite\.php?user=@$1@$2\.$3 [NC,L,QSA]
  66. # Image
  67. RewriteBase /
  68. RewriteRule ^avatars/original/missing\.png$ assets/images/missing\.png [NC,L]
  69. RewriteRule ^headers/original/missing\.png$ assets/images/missing_header\.png [NC,L]
  70. # 404
  71. RewriteRule ^404/?$ 404\.php [NC,L,QSA]
  72. ErrorDocument 404 /404
  73. </IfModule>