Advertisement
Guest User

Chez Pim .htaccess

a guest
Nov 26th, 2010
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1.  
  2. # -------------------------------------------------------
  3. # BEEF UP THE SERVER CONFIG
  4. # -------------------------------------------------------
  5. #
  6. # Change RewriteBase to a slash (/) when pushing live
  7. #
  8. AddHandler php5-script .php
  9. Options +FollowSymLinks -Indexes
  10. RewriteEngine on
  11. RewriteBase /
  12.  
  13. # -------------------------------------------------------
  14. # MAKE SURE IT GOES TO THE NON-WWW. URL
  15. # -------------------------------------------------------
  16. RewriteCond %{HTTP_HOST} ^www.chezpim.com.*
  17. RewriteCond %{HTTP_HOST} !^chezpim.com$ [NC]
  18. RewriteRule ^(.*)$ http://chezpim.com/$1 [L,R=301]
  19.  
  20. # -------------------------------------------------------
  21. # UPDATE THE PHP CONFIG
  22. # -------------------------------------------------------
  23. # Disable display of startup errors
  24. php_flag display_startup_errors off
  25.  
  26. # Disable display of all other errors
  27. php_flag display_errors off
  28.  
  29. # Disable html markup of errors
  30. php_flag html_errors off
  31.  
  32. # Enable logging of errors
  33. php_flag log_errors off
  34.  
  35. # Disable ignoring of repeat errors
  36. php_flag ignore_repeated_errors off
  37.  
  38. # Disable ignoring of unique source errors
  39. php_flag ignore_repeated_source off
  40.  
  41. # Enable logging of php memory leaks
  42. php_flag report_memleaks off
  43.  
  44. # Preserve most recent error via php_errormsg
  45. php_flag track_errors on
  46.  
  47. # Disable formatting of error reference links
  48. php_value docref_root 0
  49.  
  50. # Disable formatting of error reference links
  51. php_value docref_ext 0
  52.  
  53. # Specify path to php error log
  54. # php_value error_log php-errors.log
  55.  
  56. # Specify recording of all php errors
  57. php_value error_reporting 999999999
  58.  
  59. # Disable max error string length
  60. php_value log_errors_max_len 0
  61.  
  62. # Increase the size of uploads a user can submit
  63. php_value upload_max_filesize 20M
  64. php_value post_max_size 20M
  65. php_value max_execution_time 40
  66. php_value max_input_time 40
  67.  
  68. # -------------------------------------------------------
  69. # COMPRESS ALL FILES BEFORE THEY GET SENT
  70. # -------------------------------------------------------
  71. <IfModule mod_ext_filter.c>
  72. SetOutputFilter DEFLATE
  73. </IfModule>
  74.  
  75. # -------------------------------------------------------
  76. # CACHING
  77. # -------------------------------------------------------
  78. # 1 Month
  79. <FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|otf)$">
  80. Header set Cache-Control "max-age=2592000"
  81. </FilesMatch>
  82.  
  83. # 1 Week
  84. <FilesMatch "\.(js|css|pdf|swf)$">
  85. Header set Cache-Control "max-age=604800"
  86. </FilesMatch>
  87.  
  88. # 10 minutes
  89. <FilesMatch "\.(html|htm|txt)$">
  90. Header set Cache-Control "max-age=600"
  91. </FilesMatch>
  92.  
  93. # Don't Cache
  94. <FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
  95. Header unset Cache-Control
  96. </FilesMatch>
  97.  
  98. # -------------------------------------------------------
  99. # WORDPRESS
  100. # -------------------------------------------------------
  101. ErrorDocument 404 /404.html
  102. RewriteRule ^login wp-login.php [L]
  103.  
  104. # Redirect the old TypePad URLs to a URL that WordPress will understand
  105. RewriteRule ^blogs/pim-who.html$ /about [L,R=301]
  106. RewriteRule ^blogs/([0-9]+)/([0-9]+)/([a-zA-Z0-9\+\-\_]+).html$ /$1/$2/$3 [L,R=301]
  107. RewriteRule ^category/(bake|cook|travel|pantry|drink)$ /$1 [L,R=301]
  108. RewriteRule ^pim_et_isabelle/atom.xml$ /feed/atom$1 [L,R=301]
  109. RewriteRule ^blogs/atom.xml$ /feed/atom$1 [L,R=301]
  110. RewriteRule ^blogs/rss.xml$ /feed$1 [L,R=301]
  111.  
  112. <IfModule mod_rewrite.c>
  113. RewriteEngine On
  114. RewriteBase /
  115. RewriteRule ^index\.php$ - [L]
  116. RewriteCond %{REQUEST_FILENAME} !-f
  117. RewriteCond %{REQUEST_FILENAME} !-d
  118. RewriteRule . /index.php [L]
  119. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement