Skip to content

Instantly share code, notes, and snippets.

@aolko
Created November 9, 2015 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aolko/4586cfd9133dc0e67f98 to your computer and use it in GitHub Desktop.
Save aolko/4586cfd9133dc0e67f98 to your computer and use it in GitHub Desktop.
RewriteEngine On
ErrorDocument 404 404.php
RewriteBase /
RewriteRule ^xml/(.*)$ $1.xml
RewriteRule ^user/([A-Za-z0-9-]+)$ profile.php?username=$1
RewriteRule ^user/([A-Za-z0-9-]+)/posts$ posts.php?username=$1
RewriteRule ^community/([A-Za-z-]+)/([0-9]+)?$ community.php?cat=$1&page=$2
RewriteRule ^community/([0-9]+)?$ community.php?page=$1
RewriteRule ^community/([0-9]+)-[A-Za-z0-9-]+/$ topic.php?tId=$1
RewriteRule ^community/([0-9]+)-[A-Za-z0-9-]+/([0-9]+)$ topic.php?tId=$1&page=$2
RewriteRule ^community/([0-9]+)-[A-Za-z0-9-]+/(jump-[0-9]+)$ topic.php?tId=$1&jump=$2
RewriteRule ^users/([a-z]+)(-[a-z]+)?/?([0-9]+)?$ users.php?sort=$1&order=$2&page=$3
RewriteRule ^collections/([a-z0-9]+)/$ collections/$1.php
RewriteRule ^redirect/([a-z-]+)/$ redirect/$1.php
RewriteRule ^([a-z0-9-]+)/$ $1.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment