Forum Moderators: phranque
[edited by: jdMorgan at 2:18 pm (utc) on Feb 9, 2010]
[edit reason] Please use example.com. See TOS and Charter. [/edit]
# Turn off directory browsing
# Options -Indexes # Start the rewrite engine
# Make sure the user included www.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
# Compress the stylesheet
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# Give pages pretty URLs
RewriteRule ^([^/]+).css$ classes/CompressStyles.php?sheet=$1
# Lame and Juicy buttons
RewriteRule ^([0-9a-zA-Z\-]+)$ $1.php
RewriteRule ^([0-9a-zA-Z\-\\/]*)lame/([0-9]+)$ rate.php?value=-1&secretID=$2
RewriteRule ^([0-9a-zA-Z\-\\/]*)juicy/([0-9]+)$ rate.php?value=1&secretID=$2
# View comments
RewriteRule ^view/([0-9]+)$ comments.php?secretID=$1
# Delete comment
RewriteRule ^([0-9a-zA-Z\-\\/]*)delete-comment/([0-9]+)$ delete-comment.php?commentID=$2 # Delete entry
RewriteRule ^([0-9a-zA-Z\-\\/]*)delete-entry/([0-9]+)$ delete-entry.php?secretID=$2
# Edit entry
RewriteRule ^([0-9a-zA-Z\-\\/]*)edit-entry/([0-9]+)$ edit-entry.php?secretID=$2
# View category
RewriteRule ^view/([a-zA-Z\-]+)$ view-category.php?category=$1
# Pagination
RewriteRule ^([0-9a-zA-Z\-]+)/page([0-9]+)$ $1.php?page=$2
RewriteRule ^view/([0-9\-]+)/page([0-9]+)$ comments.php?secretID=$1&page=$2
RewriteRule ^view/([a-zA-Z\-]+)/page([0-9]+)$ view-category.php?category=$1&page=$2
RewriteRule ^page([0-9]+) index.php?page=$1
RewriteRule ^search/([0-9a-zA-Z\-\%\+]+)/page([0-9]+)$ search.php?query=$1&page=$2
# Secret submission
RewriteRule ^thank-you upcoming.php?submitted=true
# Admin Page
RewriteRule ^([0-9a-zA-Z\-\\/]*)admin admin/index.php
# Button clicking
RewriteRule ^images/buttons/([0-9a-zA-Z\-]+).png$ classes/Button.php?text=$1
# Mask all XML files as PHP pages
RewriteRule ^(.+).xml $1.php
# Page not found
ErrorDocument 404 /page-not-found