zigojacko

SM .htaccess

May 1st, 2014
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.88 KB | None | 0 0
  1. ############################################
  2. ## uncomment these lines for CGI mode
  3. ## make sure to specify the correct cgi php binary file name
  4. ## it might be /cgi-bin/php-cgi
  5.  
  6. # Action php5-cgi /cgi-bin/php5-cgi
  7. # AddHandler php5-cgi .php
  8.  
  9. ############################################
  10. ## GoDaddy specific options
  11.  
  12. # Options -MultiViews
  13.  
  14. ## you might also need to add this line to php.ini
  15. ## cgi.fix_pathinfo = 1
  16. ## if it still doesn't work, rename php.ini to php5.ini
  17.  
  18. ############################################
  19. ## this line is specific for 1and1 hosting
  20.  
  21. #AddType x-mapp-php5 .php
  22. #AddHandler x-mapp-php5 .php
  23.  
  24. ############################################
  25. ## default index file
  26.  
  27. DirectoryIndex index.php
  28.  
  29. <IfModule mod_php5.c>
  30.  
  31. ############################################
  32. ## adjust memory limit
  33.  
  34. # php_value memory_limit 64M
  35. php_value memory_limit 512M
  36. php_value max_execution_time 18000
  37.  
  38. ############################################
  39. ## disable magic quotes for php request vars
  40.  
  41. php_flag magic_quotes_gpc off
  42.  
  43. ############################################
  44. ## disable automatic session start
  45. ## before autoload was initialized
  46.  
  47. php_flag session.auto_start off
  48.  
  49. ############################################
  50. ## enable resulting html compression
  51.  
  52. #php_flag zlib.output_compression on
  53.  
  54. ###########################################
  55. # disable user agent verification to not break multiple image upload
  56.  
  57. php_flag suhosin.session.cryptua off
  58.  
  59. ###########################################
  60. # turn off compatibility with PHP4 when dealing with objects
  61.  
  62. php_flag zend.ze1_compatibility_mode Off
  63.  
  64. </IfModule>
  65.  
  66. <IfModule mod_security.c>
  67. ###########################################
  68. # disable POST processing to not break multiple image upload
  69.  
  70. SecFilterEngine Off
  71. SecFilterScanPOST Off
  72. </IfModule>
  73.  
  74. <IfModule mod_ssl.c>
  75.  
  76. ############################################
  77. ## make HTTPS env vars available for CGI mode
  78.  
  79. SSLOptions StdEnvVars
  80.  
  81. </IfModule>
  82.  
  83. <IfModule mod_rewrite.c>
  84.  
  85. ############################################
  86. ## enable rewrites
  87.  
  88. Options +FollowSymLinks -MultiViews
  89. RewriteEngine on
  90.  
  91. #RewriteCond %{REQUEST_FILENAME} !-f
  92. #RewriteCond %{REQUEST_FILENAME} !-d
  93. #RewriteRule ^([^-]+)-([^/]+)/?$ /showering/$2/filter/$1 [L,R]
  94. #RewriteRule ^showering/([^/]+)/filter/([^/]+)/?$ /$2-$1 [L,R,NC]
  95.  
  96. #RewriteRule ^/showers/alliance-showers /showering/showers/filter/alliance [L,NC]
  97. #RewriteRule ^/shop/(.*)-(.*)$ /showering/showers/$2/$1 [L,NC]
  98.  
  99. #RewriteRule ^showering/([a-zA-Z]*)-([a-zA-Z]*)$ showering/$2/filter/$1
  100.  
  101. ############################################
  102. ## canonical www 301 redirect
  103.  
  104. #RewriteCond %{HTTP_HOST} ^showermania.co.uk$ [NC]
  105. #RewriteRule ^(.*)$ http://www.showermania.co.uk/$1 [R=301,L]
  106.  
  107. ############################################
  108. ## canonical ip address 301 redirect
  109.  
  110. #RewriteCond %{HTTP_HOST} ^149\.255\.63\.57
  111. RewriteCond %{HTTP_HOST} ^146\.185\.166\.116
  112. RewriteRule (.*) http://www.showermania.co.uk/$1 [R=301,L]
  113.  
  114. ############################################
  115. ## you can put here your magento root folder
  116. ## path relative to web root
  117.  
  118. RewriteBase /
  119.  
  120. # removes index.php from the homepage url
  121. RewriteCond %{THE_REQUEST} /index\.php [NC]
  122. RewriteCond %{THE_REQUEST} !downloader
  123. RewriteRule ^(.*?)index\.php$ /$1 [L,R=302,NC,NE]
  124.  
  125. RewriteRule ^homepage/(.*)$ /$1 [R=301,L]
  126. #RewriteRule ^showering/([a-zA-Z]*)/filter/([a-zA-Z]*)$ /showering/$2-$1 [QSA,P,NC]
  127.  
  128. #RewriteRule ^showering/([a-zA-Z]*)/filter/([a-zA-Z]*)$ /showering/$2-$1 [L]
  129. #RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)/filter/([a-zA-Z]+)$ $1/$3-$2
  130.  
  131. ############################################
  132. ## rewriting brand filter URL's
  133. #RewriteRule ^$ showering/showers/filter/alliance/
  134. #RewriteRule ^(.*)$ alliance-showers
  135.  
  136. #RewriteCond %{THE_REQUEST} ^showering/showers/filter/alliance/
  137. #RewriteRule ^alliance-showers [L]
  138.  
  139. #RewriteRule ^showering/showers/filter/alliance/?$ /alliance-showers/
  140. #RewriteCond %{THE_REQUEST} !^/?showering/showers/filter/alliance/
  141. #RewriteRule .* alliance-showers/$0 [L]
  142.  
  143. #RewriteCond %{REQUEST_URI} !^/showering/showers/filter/(alliance|aquaflow)
  144. #RewriteRule (.*) /alliance-showers/$1
  145.  
  146. #RewriteCond %{HTTP_HOST} !^/showering/showers/filter/(alliance)
  147. #RewriteRule (.*) /alliance-showers/
  148.  
  149. #RewriteCond %{REQUEST_FILENAME} !-f
  150. #RewriteCond %{REQUEST_FILENAME} !-d
  151. #RewriteRule ^([^-]+)-([^/]+)/?$ /showering/$2/filter/$1 [L]
  152. #RewriteRule ^alliance-showers /showering/showers/filter/alliance [L]
  153.  
  154. #RewriteRule ^showering/([^/]+)/filter/([^/]+)/?$ /$2-$1 [L]
  155. #RewriteRule ^/showers/(.*)-(.*)$ /showering/showers/$2/$1 [L,NC]
  156.  
  157. ############################################
  158. ## custom product 301's
  159.  
  160. Redirect 301 /mira-realm-thermostatic-mixer-shower /mira-realm-er-fixed-head-thermostatic-mixer-shower
  161. Redirect 301 /mira-realm-thermo-ev-with-diverter-erd /mira-realm-thermostatic-mixer-shower-diverter-erd
  162.  
  163. ############################################
  164. ## uncomment next line to enable light API calls processing
  165.  
  166. # RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]
  167.  
  168. ############################################
  169. ## rewrite API2 calls to api.php (by now it is REST only)
  170.  
  171. RewriteRule ^api/rest api.php?type=rest [QSA,L]
  172.  
  173. ############################################
  174. ## workaround for HTTP authorization
  175. ## in CGI environment
  176.  
  177. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  178.  
  179. RewriteCond %{request_method} ^GET$
  180. RewriteCond %{REQUEST_URI} !^/downloader.*$
  181. RewriteCond %{REQUEST_URI} ^(.+)/$
  182. RewriteRule ^(.+)$ %1 [L,R=301]
  183.  
  184. ############################################
  185. ## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
  186.  
  187. RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
  188. RewriteRule .* - [L,R=405]
  189.  
  190. ############################################
  191. ## redirect for mobile user agents
  192.  
  193. #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
  194. #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
  195. #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
  196.  
  197. ############################################
  198. ## always send 404 on missing files in these folders
  199.  
  200. RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
  201.  
  202. ############################################
  203. ## never rewrite for existing files, directories and links
  204.  
  205. RewriteCond %{REQUEST_FILENAME} !-f
  206. RewriteCond %{REQUEST_FILENAME} !-d
  207. RewriteCond %{REQUEST_FILENAME} !-l
  208.  
  209. ############################################
  210. ## rewrite everything else to index.php
  211.  
  212. RewriteRule .* index.php [L]
  213.  
  214. </IfModule>
  215.  
  216.  
  217. ############################################
  218. ## Prevent character encoding issues from server overrides
  219. ## If you still have problems, use the second line instead
  220.  
  221. AddDefaultCharset Off
  222. #AddDefaultCharset UTF-8
  223.  
  224. ###<IfModule mod_expires.c>
  225.  
  226. ############################################
  227. ## Add default Expires header
  228. ## http://developer.yahoo.com/performance/rules.html#expires
  229.  
  230. ###ExpiresDefault "access plus 1 year"
  231.  
  232. ###</IfModule>
  233.  
  234. ############################################
  235. ## By default allow all access
  236.  
  237. Order allow,deny
  238. Allow from all
  239.  
  240. ###########################################
  241. ## Deny access to release notes to prevent disclosure of the installed Magento version
  242.  
  243. <Files RELEASE_NOTES.txt>
  244. order allow,deny
  245. deny from all
  246. </Files>
  247.  
  248. ############################################
  249. ## If running in cluster environment, uncomment this
  250. ## http://developer.yahoo.com/performance/rules.html#etags
  251.  
  252. #FileETag none
  253.  
  254. ############################################
  255. ## Optimisation
  256. ##
  257.  
  258. # BEGIN Compress text files
  259. <ifModule mod_deflate.c>
  260.  
  261. ############################################
  262. ## Case sensitivity fix for Magento 1.6.2.0
  263. ## https://www.sonassi.com/knowledge-base/magento-kb/magento-https-redirect-loop/
  264.  
  265. SetEnvIf HTTPS On HTTPS=on
  266.  
  267. # Detect the ELB header and set the header magento expects
  268. SetEnvIf X-Forwarded-Proto https HTTPS=on
  269.  
  270. ############################################
  271. ## enable apache served files compression
  272. ## http://developer.yahoo.com/performance/rules.html#gzip
  273.  
  274. # Insert filter on all content
  275. ###SetOutputFilter DEFLATE
  276. # Insert filter on selected content types only
  277. #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
  278. AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml x-font/otf x-font/ttf x-font/eot
  279.  
  280. # Netscape 4.x has some problems...
  281. #BrowserMatch ^Mozilla/4 gzip-only-text/html
  282.  
  283. # Netscape 4.06-4.08 have some more problems
  284. #BrowserMatch ^Mozilla/4\.0[678] no-gzip
  285.  
  286. # MSIE masquerades as Netscape, but it is fine
  287. #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  288.  
  289. # Don't compress images
  290. #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
  291.  
  292. # Make sure proxies don't deliver the wrong content
  293. #Header append Vary User-Agent env=!dont-vary
  294.  
  295. AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
  296. AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
  297. AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
  298. AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
  299. AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
  300. AddOutputFilterByType DEFLATE font/truetype font/opentype
  301. <filesMatch "\.(css|js|xml|gz|x?html?|php)$">
  302. SetOutputFilter DEFLATE
  303. </filesMatch>
  304. </ifModule>
  305. # END Compress text files
  306.  
  307. # BEGIN Expire headers
  308. <ifModule mod_expires.c>
  309. ExpiresActive On
  310. ExpiresDefault "access plus 5 seconds"
  311. ExpiresByType image/x-icon "access plus 2592000 seconds"
  312. ExpiresByType image/jpeg "access plus 2592000 seconds"
  313. ExpiresByType image/png "access plus 2592000 seconds"
  314. ExpiresByType image/gif "access plus 2592000 seconds"
  315. ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
  316. ExpiresByType text/css "access plus 604800 seconds"
  317. ExpiresByType text/javascript "access plus 216000 seconds"
  318. ExpiresByType application/javascript "access plus 216000 seconds"
  319. ExpiresByType application/x-javascript "access plus 216000 seconds"
  320. ExpiresByType text/html "access plus 600 seconds"
  321. ExpiresByType application/xhtml+xml "access plus 600 seconds"
  322. </ifModule>
  323. # END Expire headers
  324.  
  325. # BEGIN Cache-Control Headers
  326. <ifModule mod_headers.c>
  327. <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
  328. Header set Cache-Control "public"
  329. </filesMatch>
  330. <filesMatch "\.(css)$">
  331. Header set Cache-Control "public"
  332. </filesMatch>
  333. <filesMatch "\.(js)$">
  334. Header set Cache-Control "private"
  335. </filesMatch>
  336. <filesMatch "\.(x?html?|php)$">
  337. Header set Cache-Control "private, must-revalidate"
  338. </filesMatch>
  339. <FilesMatch ".(js|css|xml|gz|html)$">
  340. Header append Vary: Accept-Encoding
  341. </FilesMatch>
  342. </ifModule>
  343. # END Cache-Control Headers
  344.  
  345. # BEGIN Keep-Alive Headers
  346. <IfModule mod_headers.c>
  347. Header set Connection keep-alive
  348. </IfModule>
  349. # END Keep-Alive Headers
  350.  
  351. # BEGIN Turn ETags Off
  352. #<ifModule mod_headers.c>
  353. #Header unset ETag
  354. #</ifModule>
  355. #FileETag None
  356. # END Turn ETags Off
  357.  
  358. # BEGIN Remove Last-Modified Header
  359. #<ifModule mod_headers.c>
  360. #Header unset Last-Modified
  361. #</ifModule>
  362. # END Remove Last-Modified Header
  363.  
  364.  
  365.  
  366.  
  367. #GTspeed
  368. <IfModule mod_headers.c>
  369. <FilesMatch "\.(css|js|jpe?g|png|gif)$">
  370. Header set Cache-Control "max-age=5259487, public"
  371. </FilesMatch>
  372. </IfModule>
  373. <IfModule mod_expires.c>
  374. ExpiresActive On
  375. ExpiresByType text/css M5259487
  376. ExpiresByType text/javascript M5259487
  377. ExpiresByType application/x-javascript M5259487
  378. ExpiresByType image/jpeg M5259487
  379. ExpiresByType image/png M5259487
  380. ExpiresByType image/gif M5259487
  381. </IfModule>
  382. #GTspeed
Advertisement
Add Comment
Please, Sign In to add comment