# Block access to every file starting with a dot Require all denied # Set Error documents ErrorDocument 404 /404.php ErrorDocument 403 /404.php ErrorDocument 401 /404.php # Rewrite Stuff RewriteEngine on RewriteBase / Options +FollowSymLinks -Indexes # Rewrite Rules RewriteRule ^feedback/?$ https://github.com/circlestorm/Sakura/issues RewriteRule ^credits/?$ credits.php RewriteRule ^index/?$ index.php RewriteRule ^login/?$|^logout/?$|^activate/?$|^register/?$|^forgotpassword/?|^authenticate/?$ authenticate.php RewriteRule ^donate/?$|^support/?$ donate.php RewriteRule ^contact/?$ infopage.php?r=contact RewriteRule ^changelog/?$ changelog.php RewriteRule ^faq/?$ faq.php RewriteRule ^search/?$ search.php ## Info pages RewriteRule ^r/([a-z]+)$ infopage.php?r=$1 ## News RewriteRule ^news/?$ news.php RewriteRule ^news/([0-9]+)$ news.php?id=$1 RewriteRule ^news.xml$ news.php?xml ## Settings RewriteRule ^settings/?$ settings.php RewriteRule ^settings/([a-z]+)/?$ settings.php?mode=$1 ## Private Messages RewriteRule ^messages/?$ messages.php RewriteRule ^messages/([a-z]+)/?$ messages.php?mode=$1 ## Members RewriteRule ^members/?$ members.php RewriteRule ^members/([a-z]+)/?$ members.php?sort=$1 RewriteRule ^members/([0-9]+)/?$ members.php?rank=$1 RewriteRule ^members/p([0-9]+)/?$ members.php?page=$1 RewriteRule ^members/([a-z]+)/([0-9]+)/?$ members.php?sort=$1&rank=$2 RewriteRule ^members/([0-9]+)/p([0-9]+)/?$ members.php?rank=$1&page=$2 RewriteRule ^members/([a-z]+)/p([0-9]+)/?$ members.php?sort=$1&page=$2 RewriteRule ^members/([a-z]+)/([0-9]+)/p([0-9]+)/?$ members.php?sort=$1&rank=$2&page=$3 ## Profiles RewriteRule ^u/?$ profile.php RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/?$ profile.php?u=$1 RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/api/?$ profile.php?data RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/header/?$ imageserve.php?m=header&u=$1 RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/groups/?$ profile.php?u=$1&view=groups RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/friends/?$ profile.php?u=$1$view=friends RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/threads/?$ profile.php?u=$1$view=threads RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/posts/?$ profile.php?u=$1$view=posts # Serving Images RewriteRule ^a/([0-9]+)$|a/([0-9]+).png$ imageserve.php?m=avatar&u=$1 RewriteRule ^bg/([0-9]+)$|bg/([0-9]+).png$ imageserve.php?m=background&u=$1 # Forum RewriteRule ^forum/?$ forum/index.php RewriteRule ^forum/([0-9]+)/?$ forum/viewforum.php?id=$2 RewriteRule ^forum/(thread|topic)/([0-9]+)/?$ forum/viewtopic.php?id=$2 # Management RewriteRule ^manage/?$ manage.php RewriteRule ^manage/([a-z\-]+)/?$ manage.php?page=$1&sub=0 RewriteRule ^manage/([a-z\-]+)/([a-z\-]+)/?$ manage.php?page=$1&sub=$2