htaccess.sample 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ### GNU social "fancy URL" setup
  2. #
  3. # Change the "RewriteBase" in the new .htaccess file to be the URL path
  4. # to your GNU Social installation on your server. Typically this will
  5. # be the path to your GNU Social directory relative to your Web root.
  6. # If you are installing it in the root directory, leave it as '/'.
  7. #
  8. # If it doesn't work, double-check that AllowOverride for the GNU Social
  9. # directory is 'All' in your Apache configuration file. This can be
  10. # * /etc/apache2/apache2.conf (generic)
  11. # * /etc/apache2/sites-available/default(on Debian and Ubuntu)
  12. # * ...many other variations depending on distribution...
  13. #
  14. # See the Apache documentation for .htaccess files for more details:
  15. # https://httpd.apache.org/docs/2.4/howto/htaccess.html
  16. #
  17. # Also, check that mod_rewrite is installed and enabled:
  18. # https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html
  19. <IfModule mod_rewrite.c>
  20. RewriteEngine On
  21. # NOTE: change this to your actual GNU social base URL path,
  22. # minus the domain part:
  23. #
  24. # https://social.example.com/ => /
  25. # https://example.com/social/ => /social/
  26. #
  27. RewriteBase /
  28. #RewriteBase /mublog/
  29. ## Uncomment these if having trouble with API authentication
  30. ## when PHP is running in CGI or FastCGI mode.
  31. #
  32. #RewriteCond %{HTTP:Authorization} ^(.*)
  33. #RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
  34. RewriteCond %{REQUEST_FILENAME} !-f
  35. RewriteCond %{REQUEST_FILENAME} !-d
  36. RewriteRule (.*) index.php?p=$1 [L,QSA]
  37. ## You can also use PATHINFO by using this RewriteRule instead:
  38. # RewriteRule (.*) index.php/$1 [L,QSA]
  39. </IfModule>
  40. # Enable X-Sendfile if available. Still needs to be enabled in the config
  41. <IfModule mod_xsendfile.c>
  42. XSendFile On
  43. </IfModule>
  44. <FilesMatch "\.(ini)">
  45. <IfVersion < 2.3>
  46. Order allow,deny
  47. Deny from all
  48. </IfVersion>
  49. <IfVersion >= 2.3>
  50. Require all denied
  51. </IfVersion>
  52. </FilesMatch>