Forum Moderators: phranque
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
RewriteRule ^categories/([0-9]+)/([0-9]+)/([A-Za-z0-9-]+)/?$ http://example.net/Site/viewCategory.php?page=$1&id=$2&catname=$3 [NC,L]
RewriteRule ^monitor,([A-Za-z0-9-]+)\.php$ http://example.net/Site/track.php?id=$1 [NC,L]
RewriteRule ^Banner,_([^-]+)\.php$ http://example.net/Site/Banner.php?id=$1 [NC,L]
RewriteRule ^Count,_([^-]+)\.php$ http://example.net/Site/Counter.php?id=$1 [NC,L]
RewriteRule ^search,([^-]+)\.php$ http://example.net/Site/search.php?q=$1 [NC,L]
RewriteRule ^view/([0-9]+)/(.*)/?$ http://example.net/Site/viewSiteDetails.php?id=$1&sitename=$2 [NC,L]
#RewriteRule ^view/([0-9]+)/(.*)/?$ http://example.net/Site/viewSiteDetails.php?id=$1 [NC,L]
RewriteRule ^Directory([^-]+)\.php$ http://example.net/Site/Directory.php?page=$1 [NC,L]
RewriteRule ^index/([^-]+)\.php$ http://example.net/Site/index.php?&id=$1 [NC,L]
RewriteRule ^eXit/([^-]+)\.php$ http://example.net/Site/eXit.php?&id=$1 [NC,L]
RewriteRule ^categories/([0-9]+)/([0-9]+)/([A-Za-z0-9-]+)/?$ [b]http://example.net[/b]/Site/viewCategory.php?page=$1&id=$2&catname=$3 [NC,L]
RewriteRule ^categories/([0-9]+)/([0-9]+)/([A-Za-z0-9\-]+)/?$ /Site/viewCategory.php?page=$1&id=$2&catname=$3 [L]
^pattern/?$ allows for URL requests for both example.com/pattern and example.com/pattern/ to return the same content. ^pattern$ so that only example.com/pattern can return content. example.com/pattern/ to example.com/pattern to complete the code.
RewriteRule ^Categories/([0-9]+)/([0-9]+)/([A-Za-z0-9-]+)/?$ /Site/viewCategory.php?page=$1&id=$2&catname=$3 [L]
# Externally redirect to remove unwanted trailing slash from "Categories" URL-paths
RewriteRule ^Categories/([0-9]+/[0-9]+/[A-Za-z0-9-]+)/$ http://www.example.com/Categories/$1 [R=301,L]
#
# Internally rewrite Category URL-path requests to "viewCategory" script filepath with query parameters
RewriteRule ^Categories/([0-9]+)/([0-9]+)/([A-Za-z0-9-]+)$ /Site/viewCategory.php?page=$1&id=$2&catname=$3 [L]