.htaccess 2.5 KB

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