Advertisement
Guest User

Mybb .htaccess

a guest
Jan 11th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 5.90 KB | None | 0 0
  1. Options -MultiViews +FollowSymlinks -Indexes
  2.  
  3. #
  4. # If mod_security is enabled, attempt to disable it.
  5. # - Note, this will work on the majority of hosts but on
  6. #   MediaTemple, it is known to cause random Internal Server
  7. #   errors. For MediaTemple, please remove the block below
  8. #
  9. <IfModule mod_security.c>
  10.     # Turn off mod_security filtering.
  11.     SecFilterEngine Off
  12.  
  13.     # The below probably isn't needed, but better safe than sorry.
  14.     SecFilterScanPOST Off
  15. </IfModule>
  16.  
  17. #
  18. # MyBB "search engine friendly" URL rewrites
  19. # - Note, for these to work with MyBB please make sure you have
  20. #   the setting enabled in the Admin CP and you have this file
  21. #   named .htaccess
  22. #
  23. <IfModule mod_rewrite.c>
  24.     RewriteEngine on
  25.  
  26.     # Some hosts need a RewriteBase specification.
  27.     RewriteBase /
  28.  
  29.     # Google SEO workaround for search.php highlights:
  30.     # Make this rule the first rewrite rule in your .htaccess!
  31.     RewriteRule ^([^&]*)&(.*)$ https://example.pl/$1?$2 [L,QSA,R=301]
  32.  
  33.     # Google SEO 404:
  34.     ErrorDocument 404 /misc.php?google_seo_error=404
  35.  
  36.     # Google SEO Sitemap:
  37.     RewriteRule ^sitemap\-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]
  38.  
  39.     # Google SEO URL Forums:
  40.     RewriteRule ^Forum\-([^./]+)$ forumdisplay.php?google_seo_forum=$1 [L,QSA,NC]
  41.  
  42.     # Google SEO URL Threads:
  43.     RewriteRule ^Watek\-([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC]
  44.  
  45.     # Google SEO URL Announcements:
  46.     RewriteRule ^Ogloszenie\-([^./]+)$ announcements.php?google_seo_announcement=$1 [L,QSA,NC]
  47.  
  48.     # Google SEO URL Users:
  49.     RewriteRule ^Uzytkownik\-([^./]+)$ member.php?action=profile&google_seo_user=$1 [L,QSA,NC]
  50.  
  51.     # Google SEO URL Calendars:
  52.     RewriteRule ^Kalendarz\-([^./]+)$ calendar.php?google_seo_calendar=$1 [L,QSA,NC]
  53.  
  54.     # Google SEO URL Events:
  55.     RewriteRule ^Wydarzenie\-([^./]+)$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]
  56.  
  57.     # Default MyBB Rewrite Rules:
  58.     RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA]
  59.     RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA]
  60.  
  61.     RewriteRule ^thread-([0-9]+)\.html$ showthread.php?tid=$1 [L,QSA]
  62.     RewriteRule ^thread-([0-9]+)-page-([0-9]+)\.html$ showthread.php?tid=$1&page=$2 [L,QSA]
  63.     RewriteRule ^thread-([0-9]+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost [L,QSA]
  64.     RewriteRule ^thread-([0-9]+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest [L,QSA]
  65.     RewriteRule ^thread-([0-9]+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest [L,QSA]
  66.     RewriteRule ^thread-([0-9]+)-newpost\.html$ showthread.php?tid=$1&action=newpost [L,QSA]
  67.     RewriteRule ^thread-([0-9]+)-post-([0-9]+)\.html$ showthread.php?tid=$1&pid=$2 [L,QSA]
  68.  
  69.     RewriteRule ^post-([0-9]+)\.html$ showthread.php?pid=$1 [L,QSA]
  70.  
  71.     RewriteRule ^announcement-([0-9]+)\.html$ announcements.php?aid=$1 [L,QSA]
  72.  
  73.     RewriteRule ^user-([0-9]+)\.html$ member.php?action=profile&uid=$1 [L,QSA]
  74.  
  75.     RewriteRule ^regulamin misc.php?page=rules [L,QSA,NC]
  76.   RewriteRule ^hosting misc.php?page=host [L,QSA,NC]
  77.   RewriteRule ^voice misc.php?page=voice-server [L,QSA,NC]
  78.  
  79.     RewriteRule ^calendar-([0-9]+)\.html$ calendar.php?calendar=$1 [L,QSA]
  80.     RewriteRule ^calendar-([0-9]+)-year-([0-9]+)\.html$ calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]
  81.     RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
  82.     RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]
  83.     RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+)\.html$ calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]
  84.  
  85.     RewriteRule ^event-([0-9]+)\.html$ calendar.php?action=event&eid=$1 [L,QSA]
  86.  
  87.     <IfModule mod_env.c>
  88.         SetEnv SEO_SUPPORT 1
  89.     </IfModule>
  90. </IfModule>
  91.  
  92. #
  93. # If Apache is compiled with built in mod_deflade/GZIP support
  94. # then GZIP Javascript, CSS, HTML and XML so they're sent to
  95. # the client faster.
  96. #
  97.  
  98. # Add correct content-type for fonts
  99. AddType application/vnd.ms-fontobject .eot
  100. AddType application/x-font-ttf .ttf
  101. AddType application/x-font-opentype .otf
  102. AddType application/x-font-woff .woff
  103. AddType image/svg+xml .svg
  104.  
  105. # Compress compressible fonts
  106. AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-opentype image/svg+xml
  107.  
  108. ExpiresActive on
  109. ExpiresDefault "access plus 5 seconds"
  110. ExpiresByType text/html A1
  111. ExpiresByType application/xhtml+xml A1
  112.  
  113. # Add a far future Expires header for fonts
  114. ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
  115. ExpiresByType application/x-font-ttf "access plus 1 year"
  116. ExpiresByType application/x-font-opentype "access plus 1 year"
  117. ExpiresByType application/x-font-woff "access plus 1 year"
  118. ExpiresByType image/svg+xml "access plus 1 year"
  119.  
  120. # Add Expire header set to 30 days (far future)
  121. ExpiresByType text/css A2592000
  122. ExpiresByType text/javascript A2592000
  123. ExpiresByType application/javascript A2592000
  124. ExpiresByType application/x-javascript A2592000
  125. ExpiresByType image/gif A2592000
  126. ExpiresByType image/png A2592000
  127. ExpiresByType image/jpg A2592000
  128. ExpiresByType image/jpeg A2592000
  129. ExpiresByType image/x-icon A2592000
  130. ExpiresByType image/vnd.microsoft.icon A2592000
  131. ExpiresByType text/plain A2592000
  132.  
  133. # Add Expire header set to 1 day
  134. ExpiresByType text/xml A108000
  135. ExpiresByType application/x-httpd-php A108000
  136. ExpiresByType application/x-httpd-fastphp A108000
  137. ExpiresByType application/x-httpd-php-source A108000
  138.  
  139. # Add Expire header set to 1 hour
  140. ExpiresByType application/xml A108000
  141. ExpiresByType application/atom+xml A108000
  142. ExpiresByType application/rss+xml A108000
  143.  
  144. # Przekierowania z www oraz na https
  145.  
  146. RewriteEngine On
  147. RewriteCond %{HTTP_HOST} ^www.example.pl(.*) [NC]
  148. RewriteRule ^(.*)$ https://example.pl/$1 [R=301,L]
  149.  
  150. RewriteEngine on
  151. RewriteRule ^tag-(.*?)\.html$ tag.php?name=$1 [L,QSA]
  152. RewriteRule ^tag\.html$ tag.php [L,QSA]
  153.  
  154. RewriteEngine On
  155. RewriteCond %{HTTPS} !^on$
  156. RewriteRule ^(.*)$ https://example.pl/$1 [R=301,L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement