Advertisement
Guest User

Untitled

a guest
Sep 27th, 2015
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 5.67 KB | None | 0 0
  1. :Location /*.php
  2. Use php55
  3. :Location
  4.  
  5. #### PHPBB SEO
  6.  
  7.  
  8. <IfModule mod_rewrite.c>
  9.      # You may need to un-comment the following lines
  10.      # Options +FollowSymlinks
  11.      # To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
  12.      # Options -MultiViews
  13.      # REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
  14.      RewriteEngine On
  15.  
  16.      # Uncomment the statement below if you want to make use of
  17.      # HTTP authentication and it does not already work.
  18.      # This could be required if you are for example using PHP via Apache CGI.
  19.      # RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
  20.  
  21.      # REWRITE BASE
  22.      RewriteBase /
  23.  
  24.      # HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
  25.      # Define fully qualified ssl aware protocol
  26.      # RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
  27.      # RewriteRule ^.*$ - [env=HttpFullProto:http%2://]
  28.      # RewriteCond %{HTTP_HOST} !^forum\.motox\.com\.pl$ [NC]
  29.      # RewriteRule ^(.*)$ %{ENV:HttpFullProto}forum.motox.com.pl/$1 [QSA,L,R=301]
  30.  
  31.      # DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
  32.      RewriteCond %{REQUEST_FILENAME} -f [OR]
  33.      RewriteCond %{REQUEST_FILENAME} -d
  34.      RewriteRule . - [L]
  35.      # FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
  36.      # RewriteRule ^forum\.html$ /index.php [QSA,L,NC]
  37.      # FORUM ALL MODES
  38.      RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ /viewforum.php?f=$2&start=$4 [QSA,L,NC]
  39.      # TOPIC WITH VIRTUAL FOLDER ALL MODES
  40.      RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?f=$2&t=$4&start=$6 [QSA,L,NC]
  41.      # TOPIC WITHOUT FORUM ID & DELIM ALL MODES
  42.      RewriteRule ^([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]
  43.      # PROFILES ALL MODES WITH ID
  44.      RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)\.html$ /memberlist.php?mode=viewprofile&u=$2 [QSA,L,NC]
  45.      # USER MESSAGES ALL MODES WITH ID
  46.      RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)-(topics|posts)(-([0-9]+))?\.html$ /search.php?author_id=$2&sr=$3&start=$5 [QSA,L,NC]
  47.      # GROUPS ALL MODES
  48.      RewriteRule ^(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /memberlist.php?mode=group&g=$2&start=$4 [QSA,L,NC]
  49.      # POSTS
  50.      RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L,NC]
  51.      # ACTIVE TOPICS
  52.      RewriteRule ^active-topics(-([0-9]+))?\.html$ /search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
  53.      # UNANSWERED TOPICS
  54.      RewriteRule ^unanswered(-([0-9]+))?\.html$ /search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
  55.      # NEW POSTS
  56.      RewriteRule ^newposts(-([0-9]+))?\.html$ /search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
  57.      # UNREAD POSTS
  58.      RewriteRule ^unreadposts(-([0-9]+))?\.html$ /search.php?search_id=unreadposts&start=$2 [QSA,L,NC]
  59.      # THE TEAM
  60.      RewriteRule ^the-team\.html$ /memberlist.php?mode=team [QSA,L,NC]
  61.      # HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES
  62.      
  63.      # FORUM WITHOUT ID & DELIM ALL MODES
  64.      # THESE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
  65.      RewriteCond %{REQUEST_FILENAME} !-f
  66.      RewriteCond %{REQUEST_FILENAME} !-d
  67.      RewriteRule ^([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
  68.      # FIX RELATIVE PATHS : FILES
  69.      RewriteRule ^(style\.php|ucp\.php|mcp\.php|faq\.php|posting\.php|download/file\.php|report\.php|adm/index\.php|cron\.php)$ /$1 [QSA,L,NC,R=301]
  70.      # FIX RELATIVE PATHS : IMAGES
  71.      RewriteRule ^(styles/.*|images/.*|assets/.*|ext/.*)$ /$1 [QSA,L,NC,R=301]
  72.      #
  73.      # The following 3 lines will rewrite URLs passed through the front controller
  74.      # to not require app.php in the actual URL. In other words, a controller is
  75.      # by default accessed at /app.php/my/controller, but can also be accessed at
  76.      # /my/controller
  77.      #
  78.      RewriteCond %{REQUEST_FILENAME} !-f
  79.      RewriteCond %{REQUEST_FILENAME} !-d
  80.      RewriteRule ^(.*)$ /app.php [QSA,L]
  81.  
  82. </IfModule>
  83.  
  84. # With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
  85. # module mod_authz_host to a new module called mod_access_compat (which may be
  86. # disabled) and a new "Require" syntax has been introduced to mod_authz_host.
  87. # We could just conditionally provide both versions, but unfortunately Apache
  88. # does not explicitly tell us its version if the module mod_version is not
  89. # available. In this case, we check for the availability of module
  90. # mod_authz_core (which should be on 2.4 or higher only) as a best guess.
  91. <IfModule mod_version.c>
  92.      <IfVersion < 2.4>
  93.           <Files "config.php">
  94.                Order Allow,Deny
  95.                Deny from All
  96.           </Files>
  97.           <Files "common.php">
  98.                Order Allow,Deny
  99.                Deny from All
  100.           </Files>
  101.      </IfVersion>
  102.      <IfVersion >= 2.4>
  103.           <Files "config.php">
  104.                Require all denied
  105.           </Files>
  106.           <Files "common.php">
  107.                Require all denied
  108.           </Files>
  109.      </IfVersion>
  110. </IfModule>
  111. <IfModule !mod_version.c>
  112.      <IfModule !mod_authz_core.c>
  113.           <Files "config.php">
  114.                Order Allow,Deny
  115.                Deny from All
  116.           </Files>
  117.           <Files "common.php">
  118.                Order Allow,Deny
  119.                Deny from All
  120.           </Files>
  121.      </IfModule>
  122.      <IfModule mod_authz_core.c>
  123.           <Files "config.php">
  124.                Require all denied
  125.           </Files>
  126.           <Files "common.php">
  127.                Require all denied
  128.           </Files>
  129.      </IfModule>
  130. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement