PNA.fi koodi

htaccess.example 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Example rewrite rules for pna-based site
  2. # These should work in apache conf, or in .htaccess file.
  3. # I run these from apache conf
  4. # Allow rewrites
  5. RewriteEngine On
  6. # If accessing the index file from TUT rewrite into /tty
  7. RewriteCond %{REMOTE_ADDR} ^130\.230\.
  8. RewriteRule ^/$ /tty/ [R]
  9. RewriteRule ^/index.html$ /tty/ [R]
  10. # For each weekday, write into its specific page
  11. RewriteCond %{TIME_WDAY} 1
  12. RewriteRule ^/index.*$ /1.html
  13. RewriteCond %{TIME_WDAY} 1
  14. RewriteRule ^/(.*)/index.*$ /$1/1.html
  15. RewriteCond %{TIME_WDAY} 2
  16. RewriteRule ^/index.*$ /2.html
  17. RewriteCond %{TIME_WDAY} 2
  18. RewriteRule ^/(.*)/index.*$ /$1/2.html
  19. RewriteCond %{TIME_WDAY} 3
  20. RewriteRule ^/index.*$ /3.html
  21. RewriteCond %{TIME_WDAY} 3
  22. RewriteRule ^/(.*)/index.*$ /$1/3.html
  23. RewriteCond %{TIME_WDAY} 4
  24. RewriteRule ^/index.*$ /4.html
  25. RewriteCond %{TIME_WDAY} 4
  26. RewriteRule ^/(.*)/index.*$ /$1/4.html
  27. RewriteCond %{TIME_WDAY} 5
  28. RewriteRule ^/index.*$ /5.html
  29. RewriteCond %{TIME_WDAY} 5
  30. RewriteRule ^/(.*)/index.*$ /$1/5.html
  31. RewriteCond %{TIME_WDAY} 6
  32. RewriteRule ^/index.*$ /6.html
  33. RewriteCond %{TIME_WDAY} 6
  34. RewriteRule ^/(.*)/index.*$ /$1/6.html
  35. # For sunday, display monday which will display
  36. # the food of next monday for most restaurants
  37. RewriteCond %{TIME_WDAY} 0
  38. RewriteRule ^/index.*$ /1.html
  39. RewriteCond %{TIME_WDAY} 0
  40. RewriteRule ^/(.*)/index.*$ /$1/1.html