All pastes #629590 Raw Edit

mod_rewrite example

public shellscript v1 · immutable
·published 2007-07-22 13:29 UTC
rendered paste body
RewriteEngine on# Index PageRewriteRule ^$ /includes/validate.inc.phpRewriteRule ^index.php$ /includes/validate.inc.php# Region PagesRewriteRule ^restaurants/other/$ /other.php?%{QUERY_STRING} [NC]RewriteRule ^restaurants/other/list/$ /index2.php?%{QUERY_STRING} [NC]RewriteRule ^restaurants/other/([^/]+)/$ /Restaurants/view.php?s=other&r=$1&%{QUERY_STRING} [NC]RewriteRule ^restaurants/([^/]+)/$ /index2.php?s=$1 [NC]# Restaurant PagesRewriteRule ^id/([0-9]+)$ /Restaurants/view.php?rid=$1 [NC] [L]RewriteRule ^restaurants/([^/]+)/([^/]+)/([^/]+)/page([0-9]+) /Restaurants/view.php?s=$1&r=$2&m=$3&p=$4&%{QUERY_STRING} [NC] [L]RewriteRule ^restaurants/([^/]+)/([^/]+)/page([0-9]+) /Restaurants/view.php?s=$1&r=$2&p=$3&%{QUERY_STRING} [NC]RewriteRule ^restaurants/([^/]+)/([^/]+)/ /Restaurants/view.php?s=$1&r=$2 [NC]# SearchRewriteRule ^search/restaurants/([^/]+)/$ /Restaurants/search.php?s=$1%{QUERY_STRING} [NC]RewriteRule ^search/restaurants/([^/]+)/page([0-9]+) /Restaurants/search.php?s=$1&p=$2&%{QUERY_STRING} [NC]# OffersRewriteRule ^offers/restaurants/([^/]+)/$ /special-offers/offers.php?s=$1%{QUERY_STRING} [NC]RewriteRule ^offers/restaurants/([^/]+)/page([0-9]+) /special-offers/offers.php?s=$1&p=$2&%{QUERY_STRING} [NC]