.htaccess 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. # LTL
  14. RewriteBase /local
  15. RewriteRule ^local/?$ local\.php [NC,L]
  16. # FTL
  17. RewriteBase /federated
  18. RewriteRule ^federated/?$ federated\.php [NC,L]
  19. # Notice
  20. RewriteBase /notifications
  21. RewriteRule ^notifications/?$ notifications\.php [NC,L]
  22. # Who to follow
  23. RewriteBase /whotofollow
  24. RewriteRule ^whotofollow/?$ who_to_follow\.php [NC,L]
  25. # Search
  26. RewriteBase /search
  27. RewriteRule ^search/?$ search_hash_tag\.php [NC,L,QSA]
  28. RewriteRule ^search/users/?$ search_user\.php [NC,L,QSA]
  29. # Settings
  30. RewriteBase /settings
  31. RewriteRule ^settings/?$ settings_general\.php [NC,L]
  32. RewriteRule ^settings/profile/?$ settings_profile\.php [NC,L]
  33. RewriteRule ^settings/appearance/?$ settings_appearance\.php [NC,L]
  34. # User
  35. RewriteBase /
  36. RewriteRule ^@(.+)@(.+)\.([a-z]+)/?$ user\.php?user=@$1@$2\.$3 [NC,L,QSA]
  37. RewriteRule ^@(.+)@(.+)\.([a-z]+)/status/(.+?)?$ user\.php?user=@$1@$2\.$3&status=$4 [NC,L,QSA]
  38. RewriteRule ^@(.+)@(.+)\.([a-z]+)/media/?$ user_only_media\.php?user=@$1@$2\.$3 [NC,L,QSA]
  39. RewriteRule ^@(.+)@(.+)\.([a-z]+)/with_replies/?$ user_include_replies\.php?user=@$1@$2\.$3 [NC,L,QSA]
  40. RewriteRule ^@(.+)@(.+)\.([a-z]+)/followers/?$ user_followers\.php?user=@$1@$2\.$3 [NC,L,QSA]
  41. RewriteRule ^@(.+)@(.+)\.([a-z]+)/following/?$ user_following\.php?user=@$1@$2\.$3 [NC,L,QSA]
  42. RewriteRule ^@(.+)@(.+)\.([a-z]+)/favourites/?$ user_favorite\.php?user=@$1@$2\.$3 [NC,L,QSA]
  43. # Image
  44. RewriteBase /
  45. RewriteRule ^avatars/original/missing\.png$ assets/images/missing\.png [NC,L]
  46. RewriteRule ^headers/original/missing\.png$ assets/images/missing_header\.png [NC,L]
  47. # 404
  48. RewriteRule ^404/?$ 404\.php [NC,L,QSA]
  49. ErrorDocument 404 /404
  50. </IfModule>