AddDefaultCharset utf-8
DirectoryIndex index.php

Options -Indexes

RewriteEngine On
RewriteRule ^page/([0-9]+)$ index.php?page=$1 [L,QSA]
RewriteRule ^view/([0-9]+)$ view.php?id=$1 [L,QSA]

RewriteRule ^categories/([0-9]+)$ categories.php?id=$1 [L,QSA]
RewriteRule ^categories/([0-9]+)/([0-9]+)$ categories.php?id=$1&page=$2 [L,QSA]


RewriteRule ^search/(.*)/([0-9]+)$ search.php?q=$1&page=$2 [L,QSA]
RewriteRule ^search/(.*)$ search.php?q=$1 [L,QSA]

RewriteRule ^top$ top.php [L,QSA]
RewriteRule ^top/([0-9]+)$ top.php?page=$1 [L,QSA]

RewriteRule ^embed/([0-9]+)$ embed.php?id=$1 [L,QSA]


ErrorDocument 404 "Not Found <br /><a href=/>Go back to main page</a>"
ErrorDocument 403 "Sorry can't allow you access today, 403 Status Codes Apache <br /><a href=/>Go back to main page</a>"
ErrorDocument 400 "Bad Request <br /><a href=/>Go back to main page</a>"
ErrorDocument 500 "Internal Server Error <br /><a href=/>Go back to main page</a>"

