.htaccess.cgi 849 B

123456789101112131415161718192021222324252627282930
  1. Options +ExecCGI
  2. # AddHandler cgi-script .cgi
  3. # Other useful info for deploying on TuxFamily
  4. # https://faq.tuxfamily.org/WebArea/En#How_to_play_with_types_and_handlers
  5. Options +FollowSymLinks
  6. Options -MultiViews
  7. RewriteEngine On
  8. RewriteBase /
  9. # Redirect everything to HTTPS
  10. RewriteCond %{HTTPS} off
  11. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  12. # Remove www
  13. RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  14. RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]
  15. # Remove trailing slashes
  16. # Do we need this rule? It's probably better not to use it, as it
  17. # could interfere with any regex match in some topic.
  18. # RewriteCond %{REQUEST_FILENAME} !-d
  19. # RewriteRule ^(.*)/+$ /$1 [NC,L,R=301,QSA]
  20. # Redirect all requests to CGI script
  21. RewriteEngine On
  22. RewriteCond %{REQUEST_FILENAME} !-f
  23. RewriteRule ^(.*)$ freepost.cgi/$1 [L]