htaccess.sample 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. <FilesMatch "\.(ini)">
  41. <IfVersion < 2.3>
  42. Order allow,deny
  43. Deny from all
  44. </IfVersion>
  45. <IfVersion >= 2.3>
  46. Require all denied
  47. </IfVersion>
  48. </FilesMatch>