.htaccess 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. # Lists
  31. RewriteBase /lists
  32. RewriteRule ^lists/?$ lists\.php [NC,L]
  33. RewriteRule ^lists/(\d+)/?$ lists_view\.php?id=$1 [NC,L,QSA]
  34. RewriteRule ^lists/(\d+)/add/?$ lists_add\.php?id=$1 [NC,L,QSA]
  35. # Search
  36. RewriteBase /search
  37. RewriteRule ^search/?$ search_hash_tag\.php [NC,L,QSA]
  38. RewriteRule ^search/users/?$ search_user\.php [NC,L,QSA]
  39. # Settings
  40. RewriteBase /settings
  41. RewriteRule ^settings/?$ settings_general\.php [NC,L]
  42. RewriteRule ^settings/profile/?$ settings_profile\.php [NC,L]
  43. RewriteRule ^settings/appearance/?$ settings_appearance\.php [NC,L]
  44. # User
  45. RewriteBase /
  46. RewriteRule ^@(.+)@(.+)\.([a-z]+)/?$ user\.php?user=@$1@$2\.$3 [NC,L,QSA]
  47. RewriteRule ^@(.+)@(.+)\.([a-z]+)/status/(.+?)?$ user\.php?user=@$1@$2\.$3&status=$4 [NC,L,QSA]
  48. RewriteRule ^@(.+)@(.+)\.([a-z]+)/media/?$ user_only_media\.php?user=@$1@$2\.$3 [NC,L,QSA]
  49. RewriteRule ^@(.+)@(.+)\.([a-z]+)/with_replies/?$ user_include_replies\.php?user=@$1@$2\.$3 [NC,L,QSA]
  50. RewriteRule ^@(.+)@(.+)\.([a-z]+)/followers/?$ user_followers\.php?user=@$1@$2\.$3 [NC,L,QSA]
  51. RewriteRule ^@(.+)@(.+)\.([a-z]+)/following/?$ user_following\.php?user=@$1@$2\.$3 [NC,L,QSA]
  52. RewriteRule ^@(.+)@(.+)\.([a-z]+)/favourites/?$ user_favorite\.php?user=@$1@$2\.$3 [NC,L,QSA]
  53. # Image
  54. RewriteBase /
  55. RewriteRule ^avatars/original/missing\.png$ assets/images/missing\.png [NC,L]
  56. RewriteRule ^headers/original/missing\.png$ assets/images/missing_header\.png [NC,L]
  57. # 404
  58. RewriteRule ^404/?$ 404\.php [NC,L,QSA]
  59. ErrorDocument 404 /404
  60. </IfModule>