AdrianMarceau/mmrpg-prototype/master/.htaccess - Htaccess File

AdrianMarceau/mmrpg-prototype/master/.htaccess

# Define the cache manifest settings
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType text/cache-manifest "access plus 0 seconds"
ExpiresByType image/gif "access plus 1 months"
ExpiresByType image/jpg "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/png "access plus 1 months"
ExpiresByType audio/mpeg "access plus 1 months"
ExpiresByType audio/mp3 "access plus 1 months"
ExpiresByType audio/ogg "access plus 1 months"
ExpiresByType application/ogg "access plus 1 months"
ExpiresByType text/javascript "access plus 1 months"
ExpiresByType text/css "access plus 1 months"
</IfModule>

# Increase memory limit
#php_value memory_limit 128M

# Turn on GZIPPING if enabled
<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

# Turn on URL rewriting and set the base
RewriteEngine on
#RewriteBase /

#  Redirect non-www to the www domain
RewriteCond %{HTTP_HOST} ^www.megamanpoweredup.net$ [NC]
RewriteRule ^(.*)$ http://megamanpoweredup.net/$1 [R=301,L]

#  Redirect and rpg2k11 traffic to the non-version
RewriteCond %{HTTP_HOST} ^rpg.megamanpoweredup.net$ [NC]
RewriteRule ^rpg2k11/(.*)$ http://rpg.megamanpoweredup.net/$1 [R=301,L]

# Redirect the XML requests to their dynamic counterparts
RewriteRule ^mmrpg-info.xml$ mmrpg-info.php [L]
RewriteRule ^mmrpg-ranking.xml$ mmrpg-ranking.php [L]
RewriteRule ^sitemap.xml$ sitemap.php [L]
RewriteRule ^styles/style.css$ styles/style.php [L]

# Redirect the non-existant pages to better places
RewriteRule ^home/?$ / [R,L]
RewriteRule ^updates/?$ /community/news/ [R,L]
RewriteRule ^www.website.com$ / [R,L]

# Redirect the non-existant or renamed images to better places
RewriteRule ^images/robots/_disco/(.*)?$ /images/robots/disco_legacy/$1 [R,L]
RewriteRule ^images/robots/([a-z]+)man/(.*)?$ /images/robots/$1-man/$2 [R,L]
RewriteRule ^images/fields/elec-field/(.*)?$ /images/fields/electrical-tower/$1 [R,L]
RewriteRule ^images/fields/ice-field/(.*)?$ /images/fields/arctic-jungle/$1 [R,L]
RewriteRule ^images/fields/guts-field/(.*)?$ /images/fields/mountain-mines/$1 [R,L]
RewriteRule ^images/abilities/item-screw-small/(.*)?$ /images/items/small-screw/$1 [R,L]
RewriteRule ^images/abilities/item-screw-large/(.*)?$ /images/items/large-screw/$1 [R,L]
RewriteRule ^images/abilities/item-core-([a-z]+)/(.*)?$ /images/items/$1-core/$2 [R,L]
RewriteRule ^images/abilities/item-([-_a-z0-9]+)/(.*)?$ /images/items/$1/$2 [R,L]
RewriteRule ^(images|database)/items/core-([a-z]+)/(.*)?$ /$1/items/$2-core/$3 [R,L]
RewriteRule ^(images|database)/items/screw-([a-z]+)/(.*)?$ /$1/items/$2-screw/$3 [R,L]

# Define the rewrite conditions
#RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule (.*) - [S=19]

# Define the redirect rules for specific pages
RewriteRule ^community/personal/([0-9]+)/([-_a-z0-9]+)/([0-9]+)/??(.*)$ index.php?page=community&cat=personal&id=$1&token=$2&num=$3&$4 [L]
RewriteRule ^community/personal/([0-9]+)/([-_a-z0-9]+)/([-_a-z0-9]+)/??(.*)$ index.php?page=community&cat=personal&id=$1&token=$2&target=$3&$4 [L]
RewriteRule ^community/([-_a-z0-9]+)/([0-9]+)/([-_a-z0-9]+)/([-_a-z0-9]+)/??(.*)$ index.php?page=community&cat=$1&id=$2&token=$3&num=$4&$5 [L]
RewriteRule ^community/([-_a-z0-9]+)/([0-9]+)/([-_a-z0-9]+)/???(.*)$ index.php?page=community&cat=$1&id=$2&token=$3&$4 [L]
RewriteRule ^community/([-_a-z0-9]+)/([0-9]+)/???(.*)$ index.php?page=community&cat=$1&num=$2&$3 [L]
RewriteRule ^community/([-_a-z0-9]+)/([-_a-z0-9]+)/???(.*)$ index.php?page=community&cat=$1&sub=$2&$3 [L]
RewriteRule ^community/([-_a-z0-9]+)/??(.*)$ index.php?page=community&cat=$1&$2 [L]

RewriteRule ^file/game/([-_a-z0-9]+)/???(.*)$ index.php?page=file&sub=game&token=$1 [L]

RewriteRule ^leaderboard/([0-9]+)/??(.*)$ index.php?page=leaderboard&num=$1&$2 [L]
RewriteRule ^leaderboard/([-_a-z0-9]+)/([-_a-z0-9]+)/(dr-light|dr-wily|dr-cossack)/???(.*)$ index.php?page=leaderboard&sub=$1&token=$2&player=$3 [L]
RewriteRule ^leaderboard/([-_a-z0-9]+)/([-_a-z0-9]+)/???(.*)$ index.php?page=leaderboard&sub=$1&token=$2 [L]
RewriteRule ^leaderboard/([-_a-z0-9]+)/??(.*)$ index.php?page=leaderboard&sub=$1&$2 [L]

RewriteRule ^database/(players|abilities|robots|mechas|bosses|types|fields|items)/([-_a-z0-9]+)/???(.*)$ index.php?page=database&sub=$1&token=$2 [L]
RewriteRule ^database/(players|abilities|robots|mechas|bosses|types|fields|items)/??(.*)$ index.php?page=database&sub=$1&$2 [L]

RewriteRule ^(home|about|gallery|community|leaderboard|database|prototype|credits|contact|file)/([0-9]+)/???(.*)$ index.php?page=$1&num=$2&$3 [L]
RewriteRule ^(home|about|gallery|community|leaderboard|database|prototype|credits|contact|file)/([-_a-z0-9]+)/([0-9]+)/???(.*)$ index.php?page=$1&sub=$2&num=$3&$4 [L]
RewriteRule ^(home|about|gallery|community|leaderboard|database|prototype|credits|contact|file)/([-_a-z0-9]+)/?(.*)?$ index.php?page=$1&sub=$2&$3 [L]
RewriteRule ^(home|about|gallery|community|leaderboard|database|prototype|credits|contact|file|error)/???(.*)$ index.php?page=$1&$2 [L]

On Github License

Files

Download PDF of Htaccess file
HTTP_HOST, REQUEST_FILENAME

Comments

Apache