Options +FollowSymLinks -MultiViews +Indexes
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>
# Cache Control
<IfModule mod_headers.c>
<FilesMatch "\.(jpg|jpeg|png|gif|swf|css|js)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
</IfModule>
RewriteEngine on
RewriteOptions MaxRedirects=1
RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule .* - [L]
# Installer
RewriteRule ^install/?$ install.php [L]
# Static Pages
RewriteRule ^static/([^/]+)/?$ static.php?url=$1 [L]
# Contacts
RewriteRule ^contacts/?$ contact.php [L]
# Directory
RewriteRule ^directory/?$ directory.php [L]
RewriteRule ^directory/([^/]+)/?$ directory.php?view=$1 [L]
RewriteRule ^directory/([^/]+)/([^/]+)/?$ directory.php?view=$1&page=$2 [L]
# Search
RewriteRule ^search/?$ search.php [L]
RewriteRule ^search/hashtag/([^/]+)/?$ search.php?query=$1&hashtag=1 [L]
RewriteRule ^search/([^/]+)/?$ search.php?query=$1&hashtag=0 [L]
# Sign(in|up|out)
RewriteRule ^signin/?$ sign.php?do=in [L]
RewriteRule ^signup/?$ sign.php?do=up [L]
RewriteRule ^signout/?$ sign.php?do=out [L]
RewriteRule ^reset/?$ sign.php?do=reset [L]
RewriteRule ^activation/([^/]+)/([^/]+)/?$ activation.php?id=$1&token=$2 [L]
# Social Logins
RewriteRule ^connect/([^/]+)/?$ connect.php?do=connect&provider=$1 [L]
RewriteRule ^revoke/([^/]+)/?$ connect.php?do=revoke&provider=$1 [L]
# Packages
RewriteRule ^packages/?$ packages.php [L]
# Started
RewriteRule ^started/?$ started.php [L]
RewriteRule ^started/finished?$ started.php?finished=true [L]
# Messages
RewriteRule ^messages/?$ messages.php [L]
RewriteRule ^messages/new?$ messages.php?view=new [L]
RewriteRule ^messages/([^/]+)/?$ messages.php?cid=$1 [L]
# Notifications
RewriteRule ^notifications/?$ notifications.php [L]
# Settings
RewriteRule ^settings/?$ settings.php [L]
RewriteRule ^settings/([^/]+)/?$ settings.php?view=$1 [L]
# Posts & Photos
RewriteRule ^posts/([^/]+)/?$ post.php?post_id=$1 [L]
RewriteRule ^photos/([^/]+)/?$ photo.php?photo_id=$1 [L]
# Saved
RewriteRule ^saved/?$ index.php?view=saved [L]
# People
RewriteRule ^people/?$ people.php [L]
RewriteRule ^people/find/?$ people.php?view=find [L]
RewriteRule ^people/friend_requests/?$ people.php?view=friend_requests [L]
RewriteRule ^people/sent_requests/?$ people.php?view=sent_requests [L]
# Pages
RewriteRule ^pages/?$ pages.php [L]
RewriteRule ^pages/liked/?$ pages.php?view=liked [L]
RewriteRule ^pages/manage/?$ pages.php?view=manage [L]
RewriteRule ^pages/([^/]+)/?$ page.php?username=$1 [L,QSA]
RewriteRule ^pages/([^/]+)/([^/]+)/?$ page.php?username=$1&view=$2 [L]
RewriteRule ^pages/([^/]+)/([^/]+)/([^/]+)/?$ page.php?username=$1&view=$2&id=$3 [L]
# Groups
RewriteRule ^groups/?$ groups.php [L]
RewriteRule ^groups/joined/?$ groups.php?view=joined [L]
RewriteRule ^groups/manage/?$ groups.php?view=manage [L]
RewriteRule ^groups/([^/]+)/?$ group.php?username=$1 [L,QSA]
RewriteRule ^groups/([^/]+)/([^/]+)/?$ group.php?username=$1&view=$2 [L]
RewriteRule ^groups/([^/]+)/([^/]+)/([^/]+)/?$ group.php?username=$1&view=$2&id=$3 [L]
# Events
RewriteRule ^events/?$ events.php [L]
RewriteRule ^events/going/?$ events.php?view=going [L]
RewriteRule ^events/interested/?$ events.php?view=interested [L]
RewriteRule ^events/invited/?$ events.php?view=invited [L]
RewriteRule ^events/manage/?$ events.php?view=manage [L]
RewriteRule ^events/([^/]+)/?$ event.php?event_id=$1 [L,QSA]
RewriteRule ^events/([^/]+)/([^/]+)/?$ event.php?event_id=$1&view=$2 [L]
RewriteRule ^events/([^/]+)/([^/]+)/([^/]+)/?$ event.php?event_id=$1&view=$2&id=$3 [L]
# Blogs
RewriteRule ^articles/?$ index.php?view=articles [L]
RewriteRule ^blogs/?$ blogs.php [L]
RewriteRule ^blogs/new/?$ blogs.php?view=new [L]
RewriteRule ^blogs/edit/([^/]+)/?$ blogs.php?view=edit&post_id=$1 [L]
RewriteRule ^blogs/([^/]+)/([^/]+)/?$ blogs.php?view=article&post_id=$1 [L]
# Market
RewriteRule ^products/?$ index.php?view=products [L]
RewriteRule ^market/?$ market.php [L]
RewriteRule ^market/search/?$ market.php?view=search [L]
RewriteRule ^market/search/([^/]+)/?$ market.php?view=search&query=$1 [L]
RewriteRule ^market/search/([^/]+)/([^/]+)/?$ market.php?view=search&query=$1&page=$2 [L]
RewriteRule ^market/category/([^/]+)/?$ market.php?view=category&category_id=$1 [L]
RewriteRule ^market/category/([^/]+)/([^/]+)/?$ market.php?view=category&category_id=$1&category_url=$2 [L]
RewriteRule ^market/category/([^/]+)/([^/]+)/([^/]+)/?$ market.php?view=category&category_id=$1&category_url=$2&page=$3 [L]
RewriteRule ^market/([^/]+)/?$ market.php?page=$1 [L]
# Games
RewriteRule ^games/?$ games.php [L]
RewriteRule ^games/played/?$ games.php?view=played [L]
RewriteRule ^games/([^/]+)/?$ game.php?id=$1 [L]
# Admin Panel
RewriteRule ^admincp/?$ admin.php [L]
RewriteRule ^admincp/([^/]+)/?$ admin.php?view=$1 [L]
RewriteRule ^admincp/([^/]+)/([^/]+)/?$ admin.php?view=$1&sub_view=$2 [L]
RewriteRule ^admincp/([^/]+)/([^/]+)/([^/]+)/?$ admin.php?view=$1&sub_view=$2&id=$3 [L]
# Profile
RewriteRule ^([^/]+)/?$ profile.php?username=$1 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/?$ profile.php?username=$1&view=$2 [L]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/?$ profile.php?username=$1&view=$2&id=$3 [L]
Options +FollowSymLinks -MultiViews +Indexes
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>
Match \.(htaccss|htpasswd|ini|log|sh|inc|bak|tpl)$ DenyAccess
RewriteEngine on
RewriteOptions MaxRedirects=1
RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule .* - [L]
RequestURI exists Return
RewriteRule ^install/?$ install.php [L]
Match ^install/?$ Rewrite install.php
<IfModule mod_headers.c>
<FilesMatch "\.(jpg|jpeg|png|gif|swf|css|js)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
</IfModule>
RewriteRule ^hello hello.php [L]
Match ^/hello Rewrite /hello.php
Directory {
DirectoryID = cache-control
Path = /
Extensions = gif, png, jpg, jpeg, js, swf, css
ExpirePeriod = 1 week, public
}
UseDirectory = cache-control