Advertisement
Guest User

yes

a guest
Jun 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.96 KB | None | 0 0
  1. Options +FollowSymLinks
  2. Options -Indexes
  3.  
  4. RewriteEngine On
  5. RewriteOptions inherit
  6. RewriteBase /
  7.  
  8. # Handles Non-SSL redirect to WWW
  9. RewriteCond %{HTTP_HOST} !^www\. [NC]
  10. RewriteCond %{HTTP_HOST} !footbridgemobile [NC]
  11. RewriteCond %{HTTP_HOST} !referralx [NC]
  12. RewriteCond %{HTTP_HOST} !^[\d]{1,3}\.[\d]{1,3}\. [NC]
  13. RewriteCond %{HTTP_HOST} !^localhost [NC]
  14. RewriteCond %{HTTPS} off
  15. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
  16.  
  17. # Handles SSL redirect to WWW
  18. RewriteCond %{HTTP_HOST} !^www\. [NC]
  19. RewriteCond %{HTTP_HOST} !footbridgemobile [NC]
  20. RewriteCond %{HTTP_HOST} !referralx [NC]
  21. RewriteCond %{HTTP:X-Forwarded-Proto} https [OR]
  22. RewriteCond %{HTTPS} on
  23. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
  24.  
  25. # Force SSL (uncomment to use)
  26. RewriteCond %{HTTP:X-Forwarded-Proto} !https
  27. RewriteCond %{HTTPS} off
  28. RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
  29.  
  30. #####################################################################
  31. ####################### Land of Redirects ###########################
  32. #####################################################################
  33.  
  34. RewriteCond %{REQUEST_URI} /pageName.php
  35. RewriteRule ^(.+)$ /toPageName.php [L,R=301]
  36.  
  37.  
  38. # Services
  39. RewriteCond %{REQUEST_URI} /Long-Island-remodeling/kitchen-remodel.php
  40. RewriteRule ^(.+)$ /home-remodeling/kitchen-remodeling.php [L,R=301]
  41.  
  42. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/replacement-windows.php
  43. RewriteRule ^(.+)$ /long-island/replacement-windows.php [L,R=301]
  44.  
  45. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/door-replacement.php
  46. RewriteRule ^(.+)$ /long-island/replacement-doors.php [L,R=301]
  47.  
  48. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/porticos.php
  49. RewriteRule ^(.+)$ /long-island/porticos.php [L,R=301]
  50.  
  51. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/concrete.php
  52. RewriteRule ^(.+)$ /long-island/masonry.php [L,R=301]
  53.  
  54. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/driveways-patios.php
  55. RewriteRule ^(.+)$ /long-island/ [L,R=301]
  56.  
  57. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/walkways-steps.php
  58. RewriteRule ^(.+)$ /long-island/stoops-railings.php [L,R=301]
  59.  
  60. RewriteCond %{REQUEST_URI} /Long-Island-remodeling/bathroom-remodel.php
  61. RewriteRule ^(.+)$ /home-remodeling/bathroom-remodeling.php [L,R=301]
  62.  
  63. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/vinyl-siding.php
  64. RewriteRule ^(.+)$ /long-island/vinyl-siding.php [L,R=301]
  65.  
  66. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/fiber-cememt-siding.php
  67. RewriteRule ^(.+)$ /long-island/vinyl-siding.php [L,R=301]
  68.  
  69. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/fencing.php
  70. RewriteRule ^(.+)$ /long-island/fencing.php [L,R=301]
  71.  
  72. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/solar-panels.php
  73. RewriteRule ^(.+)$ /long-island/solar-panels.php [L,R=301]
  74.  
  75. RewriteCond %{REQUEST_URI} /Long-Island-home-improvement/
  76. RewriteRule ^(.+)$ /home-remodeling/ [L,R=301]
  77.  
  78. # City Pages
  79.  
  80. RewriteCond %{REQUEST_URI} /NY/Amityville-remodeling.php
  81. RewriteRule ^(.+)$ /ny-remodel/amityville-remodeling-company.php [L,R=301]
  82.  
  83. RewriteCond %{REQUEST_URI} /NY/Babylon-remodeling.php
  84. RewriteRule ^(.+)$ /ny-remodel/bathroom-remodeling-babylon.php [L,R=301]
  85.  
  86. RewriteCond %{REQUEST_URI} /NY/Bay-Shore-remodeling.php
  87. RewriteRule ^(.+)$ /ny-remodel/bay-shore-bathroom-remodeling.php [L,R=301]
  88.  
  89. RewriteCond %{REQUEST_URI} /NY/Bayside-remodeling.php
  90. RewriteRule ^(.+)$ /ny-remodel/bayside-remodeling.php [L,R=301]
  91.  
  92. RewriteCond %{REQUEST_URI} /NY/Far-rockaway-remodeling.php
  93. RewriteRule ^(.+)$ /ny-remodel/far-rockaway-remodeling.php [L,R=301]
  94.  
  95. RewriteCond %{REQUEST_URI} /NY/Flushing-remodeling.php
  96. RewriteRule ^(.+)$ /ny-remodel/flushing-remodeling.php [L,R=301]
  97.  
  98. RewriteCond %{REQUEST_URI} /NY/Jamaica-remodeling.php
  99. RewriteRule ^(.+)$ /ny-remodel/jamaica-remodeling.php [L,R=301]
  100.  
  101. RewriteCond %{REQUEST_URI} /NY/Little-Neck-remodeling.php
  102. RewriteRule ^(.+)$ /ny-remodel/little-neck-remodeling.php [L,R=301]
  103.  
  104. RewriteCond %{REQUEST_URI} /NY/Queens-Village-remodeling.php
  105. RewriteRule ^(.+)$ /ny-remodel/queens-village-remodeling.php [L,R=301]
  106.  
  107. RewriteCond %{REQUEST_URI} /NY/South-Ozone-Park-remodeling.php
  108. RewriteRule ^(.+)$ /ny-remodel/south-ozone-park-remodeling.php [L,R=301]
  109.  
  110. RewriteCond %{REQUEST_URI} /NY/Springfield-Gardens-remodeling.php
  111. RewriteRule ^(.+)$ /ny-remodel/springfield-gardens-remodeling.php [L,R=301]
  112.  
  113. RewriteCond %{REQUEST_URI} /NY/Suffolk-remodeling.php
  114. RewriteRule ^(.+)$ /ny-remodel/suffolk-remodeling-contractor.php [L,R=301]
  115.  
  116. RewriteCond %{REQUEST_URI} /NY/Queens-remodeling.php
  117. RewriteRule ^(.+)$ /ny-remodel/queens-remodeling.php [L,R=301]
  118.  
  119. RewriteCond %{REQUEST_URI} /NY/Brooklyn-remodeling.php
  120. RewriteRule ^(.+)$ /ny-remodel/remodeling-brooklyn.php [L,R=301]
  121.  
  122. RewriteCond %{REQUEST_URI} /NY/
  123. RewriteRule ^(.+)$ /ny-remodel/ [L,R=301]
  124.  
  125.  
  126. ErrorDocument 404 /404.php
  127.  
  128. <IfModule mod_deflate.c>
  129. # Compress HTML, CSS, JavaScript, Text, XML and fonts
  130. AddOutputFilterByType DEFLATE application/javascript
  131. AddOutputFilterByType DEFLATE application/rss+xml
  132. AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  133. AddOutputFilterByType DEFLATE application/x-font
  134. AddOutputFilterByType DEFLATE application/x-font-opentype
  135. AddOutputFilterByType DEFLATE application/x-font-otf
  136. AddOutputFilterByType DEFLATE application/x-font-truetype
  137. AddOutputFilterByType DEFLATE application/x-font-ttf
  138. AddOutputFilterByType DEFLATE application/x-javascript
  139. AddOutputFilterByType DEFLATE application/xhtml+xml
  140. AddOutputFilterByType DEFLATE application/xml
  141. AddOutputFilterByType DEFLATE font/opentype
  142. AddOutputFilterByType DEFLATE font/otf
  143. AddOutputFilterByType DEFLATE font/ttf
  144. AddOutputFilterByType DEFLATE image/svg+xml
  145. AddOutputFilterByType DEFLATE image/x-icon
  146. AddOutputFilterByType DEFLATE text/css
  147. AddOutputFilterByType DEFLATE text/html
  148. AddOutputFilterByType DEFLATE text/javascript
  149. AddOutputFilterByType DEFLATE text/plain
  150. AddOutputFilterByType DEFLATE text/xml
  151. </IfModule>
  152.  
  153. # Caching
  154. <IfModule mod_expires.c>
  155. ExpiresActive On
  156. ExpiresByType image/jpg "access 1 week"
  157. ExpiresByType image/jpeg "access 1 week"
  158. ExpiresByType image/gif "access 1 week"
  159. ExpiresByType image/png "access 1 week"
  160. ExpiresByType text/css "access 1 week"
  161. ExpiresByType text/html "access 1 week"
  162. ExpiresByType application/pdf "access 1 week"
  163. ExpiresByType text/x-javascript "access 1 week"
  164. ExpiresByType application/javascript "access plus 1 week"
  165. ExpiresByType application/x-javascript "access plus 1 week"
  166. ExpiresByType application/x-shockwave-flash "access 1 week"
  167. ExpiresByType image/x-icon "access 1 week"
  168. ExpiresDefault "access 1 week"
  169. </IfModule>
  170.  
  171. # New servers may not handle .php errors correctly
  172. RewriteCond %{REQUEST_URI} \.php$
  173. RewriteCond %{REQUEST_FILENAME} !-f
  174. RewriteRule ^(.+)$ /404.php
  175.  
  176. # Redirect index pages to non-index duplicates
  177. RewriteCond %{REQUEST_URI} (.+)/index.php$
  178. RewriteRule ^(.+)$ %1/ [L,R=301]
  179.  
  180. RewriteCond %{REQUEST_URI} ^/index.php$
  181. RewriteRule ^(.+)$ / [L,R=301]
  182.  
  183. # The following rules handle the fact that some file types may have different ways of being typed.
  184. # They also have different spellings (JPEG vs jpeg vs JPG vs jpg)
  185.  
  186. RewriteCond %{REQUEST_URI} (.+)\.jpg$
  187. RewriteCond %{REQUEST_FILENAME} !-f
  188. RewriteRule ^(.+)$ %1.jpeg
  189.  
  190. RewriteCond %{REQUEST_URI} (.+)\.jpeg$
  191. RewriteCond %{REQUEST_FILENAME} !-f
  192. RewriteRule ^(.+)$ %1.JPG
  193.  
  194. RewriteCond %{REQUEST_URI} (.+)\.JPG$
  195. RewriteCond %{REQUEST_FILENAME} !-f
  196. RewriteRule ^(.+)$ %1.JPEG
  197.  
  198. RewriteCond %{REQUEST_URI} (.+)\.JPEG$
  199. RewriteCond %{REQUEST_FILENAME} !-f
  200. RewriteRule ^(.+)$ %1.JPG [L]
  201.  
  202. RewriteCond %{REQUEST_URI} (.+)\.png$
  203. RewriteCond %{REQUEST_FILENAME} !-f
  204. RewriteRule ^(.+)$ %1.PNG
  205.  
  206. RewriteCond %{REQUEST_URI} (.+)\.PNG$
  207. RewriteCond %{REQUEST_FILENAME} !-f
  208. RewriteRule ^(.+)$ %1.png [L]
  209.  
  210. RewriteCond %{REQUEST_URI} (.+)\.pdf$
  211. RewriteCond %{REQUEST_FILENAME} !-f
  212. RewriteRule ^(.+)$ %1.PDF
  213.  
  214. RewriteCond %{REQUEST_URI} (.+)\.PDF$
  215. RewriteCond %{REQUEST_FILENAME} !-f
  216. RewriteRule ^(.+)$ %1.pdf [L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement