#Sin indices de directorio
Options -Indexes
# ErrorDocs
ErrorDocument 400 /errorDoc.php?e=400
ErrorDocument 401 /errorDoc.php?e=401
ErrorDocument 403 /errorDoc.php?e=403
ErrorDocument 404 /errorDoc.php?e=404
ErrorDocument 500 /errorDoc.php?e=500
<FILES ~ "error_log">
Order allow,deny
Deny from all
</FILES>
# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
# Set up caching on media files for 1 month
<FilesMatch ".(gif|jpg|jpeg|png)$">
ExpiresDefault A2629743
Header append Cache-Control "public"
</FilesMatch>
# Set up 1 day caching on commonly updated files
<FilesMatch ".(js|css)$">
ExpiresDefault A86400
ExpiresDefault A1
Header append Cache-Control "proxy-revalidate"
</FilesMatch>
# Set up caching on media files for 1 year
<FilesMatch ".(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>
# this is the initialization
# For security reasons, Option followsymlinks cannot be overridden.
# Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
RewriteEngine On
# these are the rewrite conditions
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Information pages
RewriteRule ^info/([A-Za-z-]+)/?$ /info.php?title=$1 [NC,QSA]
#Users
# Public profiles
RewriteRule ^user/([0-9]+)/?$ /user.php?id=$1 [NC,QSA]
# People the user follows
RewriteRule ^user/following/([0-9]+)/?$ /following.php?id=$1 [NC,QSA]
# Invitations
RewriteRule ^invite/([0-9]+)/?$ /invitation.php?id=$1 [NC,QSA]
# Session management
# Change password
RewriteRule ^reset/([0-9]+)/([A-Za-z0-9]+)/?$ /resetPass.php?id=$1&secret=$2 [NC,QSA]
# Account verification
RewriteRule ^verify/([0-9]+)/([A-Za-z0-9]+)/?$ /verify.php?id=$1&code=$2 [NC,QSA]
# Custom XML files
RewriteRule ^([A-Za-z0-9]+).xml$ /generateXML.php?type=$1 [NC,QSA]
# Open normal PHP files
RewriteRule ^do/(.*)$ /$1.php [NC,QSA]
# Custom Maps
RewriteRule ^http://maps.quepiensas.es/1/(.*)$ http://maps.google.com/maps/api/staticmap?center=$1&zoom=8&size=692x290&maptype=roadmap&sensor=false&style=feature:all%7Celement:geometry%7Clightness:70&style=feature:all%7Celement:labels%7Cvisibility:off&style=feature:landscape%7Chue:0xffffff%7Clightness:100 [NC,QSA]
RewriteRule ^http://maps.quepiensas.es$ /maps.php [NC,QSA]
# Unkown user pic for 404 photos
RewriteRule ^http://img.quepiensas.es/errorDoc.php?e=([0-9]+)$ quepiensas.es/errorDoc.php?e=$1 [NC,QSA]
# People
# List of followers for a given person
RewriteRule ^([0-9]+)/followers/?$ /personFollowers.php?id=$1 [NC,QSA]
# Main rule for people
RewriteRule ^([0-9]+)/?$ /persona.php?id=$1&var1=$2 [NC,QSA]
# New person
RewriteRule ^([áéíóúñÁÉÍÓÚÑäëïöüÄËÏÖÜçÇA-Za-z-]+)/?$ /newPerson.php?person=$1 [L,NC,QSA]