punbb/include/rewrite_rules.php
author Dan
Sat, 05 Apr 2008 23:56:45 -0400
changeset 6 5e1f1e916419
permissions -rw-r--r--
Big upgrade to 1.3 beta. Basic things are working.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     1
<?php
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     2
/***********************************************************************
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     3
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     4
  Copyright (C) 2002-2008  PunBB.org
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     5
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     6
  This file is part of PunBB.
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     7
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     8
  PunBB is free software; you can redistribute it and/or modify it
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
     9
  under the terms of the GNU General Public License as published
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    10
  by the Free Software Foundation; either version 2 of the License,
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    11
  or (at your option) any later version.
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    12
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    13
  PunBB is distributed in the hope that it will be useful, but
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    14
  WITHOUT ANY WARRANTY; without even the implied warranty of
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    16
  GNU General Public License for more details.
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    17
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    18
  You should have received a copy of the GNU General Public License
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    19
  along with this program; if not, write to the Free Software
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    20
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    21
  MA  02111-1307  USA
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    22
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    23
************************************************************************/
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    24
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    25
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    26
$pun_rewrite_rules = array(
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    27
	'/^topic[\/_-]?([0-9]+).*(new|last)[\/_-]?(post)?s?(\.html?|\/)?$/i'													=>	'viewtopic.php?id=$1&action=$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    28
	'/^post[\/_-]?([0-9]+)(\.html?|\/)?$/i'																					=>	'viewtopic.php?pid=$1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    29
	'/^(forum|topic)[\/_-]?([0-9]+).*[\/_-]p(age)?[\/_-]?([0-9]+)(\.html?|\/)?$/i'											=>	'view$1.php?id=$2&p=$4',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    30
	'/^(f|t)(orum|opic)[\/_-]?([0-9]+)[\/_-](rss|atom)(\.html?|\/)?$/i'														=>	'extern.php?action=feed&$1id=$3&type=$4',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    31
	'/^(forum|topic)[\/_-]?([0-9]+).*(\.html?|\/)?$/i'																		=>	'view$1.php?id=$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    32
	'/^new[\/_-]?reply[\/_-]?([0-9]+)(\.html?|\/)?$/i'																		=>	'post.php?tid=$1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    33
	'/^new[\/_-]?reply[\/_-]?([0-9]+)[\/_-]?quote[\/_-]?([0-9]+)(\.html?|\/)?$/i'											=>	'post.php?tid=$1&qid=$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    34
	'/^new[\/_-]?topic[\/_-]?([0-9]+)(\.html?|\/)?$/i'																		=>	'post.php?fid=$1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    35
	'/^(delete|edit)[\/_-]?([0-9]+)(\.html?|\/)?$/i'																		=>	'$1.php?id=$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    36
	'/^(login|search|register)(\.html?|\/)?$/i'																				=>	'$1.php',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    37
	'/^logout[\/_-]?([0-9]+)[\/_-]([a-z0-9]+)(\.html?|\/)?$/i'																=>	'login.php?action=out&id=$1&csrf_token=$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    38
	'/^request[\/_-]?password(\.html?|\/)?$/i'																				=>	'login.php?action=forget',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    39
	'/^user[\/_-]?([0-9]+)(\.html?|\/)?$/i'																					=>	'profile.php?id=$1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    40
	'/^user[\/_-]?([0-9]+)[\/_-]?([a-z]+)(\.html?|\/)?$/i'																	=>	'profile.php?section=$2&id=$1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    41
	'/^(change|delete|upload)[\/_-]?(email|pass|avatar|user)(word)?[\/_-]?([0-9]+)(\.html?|\/)?$/i'							=>	'profile.php?action=$1_$2&id=$4',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    42
	'/^change[\/_-]?(email|pass)(word)?[\/_-]?([0-9]+)[\/_-]([a-zA-Z0-9]+)(\.html?|\/)?$/i'									=>	'profile.php?action=change_$1&id=$3&key=$4',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    43
	'/^search[\/_-]?(new|recent|unanswered|subscriptions)(\.html?|\/)?$/i'													=>	'search.php?action=show_$1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    44
	'/^search[\/_-]?(new|recent|unanswered|subscriptions)[\/_-]p(age)?[\/_-]?([0-9]+)(\.html?|\/)?$/i'						=>	'search.php?action=show_$1&p=$3',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    45
	'/^search[\/_-]?([0-9]+)(\.html?|\/)?$/i'																				=>	'search.php?search_id=$1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    46
	'/^search[\/_-]?([0-9]+)[\/_-]?p(age)?[\/_-]?([0-9]+)(\.html?|\/)?$/i'													=>	'search.php?search_id=$1&p=$3',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    47
	'/^search[\/_-]?(posts|topics)[\/_-]?user[\/_-]?([0-9]+)(\.html?|\/)?$/i'												=>	'search.php?action=show_user_$1&user_id=$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    48
	'/^search[\/_-]?(posts|topics)[\/_-]?user[\/_-]?([0-9]+)[\/_-]?p(age)?[\/_-]?([0-9]+)(\.html?|\/)?$/i'					=>	'search.php?action=show_user_$1&user_id=$2&p=$4',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    49
	'/^search\/k(.*)\/([0-9-]+)\/a(.*)\/(message|subject|all)\/([0-9]+)\/(ASC|DESC)\/(posts|topics)\/?$/i'					=>	'search.php?action=search&keywords=$1&author=$3&forum=$2&search_in=$4&sort_by=$5&sort_dir=$6&show_as=$7',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    50
	'/^search\/k(.*)\/([0-9-]+)\/a(.*)\/(message|subject|all)\/([0-9]+)\/(ASC|DESC)\/(posts|topics)\/page\/([0-9]+)\/?$/i'	=>	'search.php?action=search&keywords=$1&author=$3&forum=$2&search_in=$4&sort_by=$5&sort_dir=$6&show_as=$7&p=$8',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    51
	'/^search-k(.*)-([0-9-]+)-a(.*)-(message|subject|all)-([0-9]+)-(ASC|DESC)-(posts|topics).html?$/i'						=>	'search.php?action=search&keywords=$1&author=$3&forum=$2&search_in=$4&sort_by=$5&sort_dir=$6&show_as=$7',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    52
	'/^search-k(.*)-(message|subject|all)-a(.*)-([0-9]+)-(ASC|DESC)-([0-9-]+)-(posts|topics)-p([0-9]+).html?$/i'			=>	'search.php?action=search&keywords=$1&author=$3&forum=$6&search_in=$2&sort_by=$4&sort_dir=$5&show_as=$7&p=$8',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    53
	'/^users(\.html?|\/)?$/i'																								=>	'userlist.php',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    54
	'/^users\/(.*)\/([0-9-]+)\/?([a-z_]+)[\/_-]([a-zA-Z]+)[\/_-]p(age)?[\/_-]?([0-9]+)(\.html?|\/)?$/i'						=>	'userlist.php?username=$1&show_group=$2&sort_by=$3&sort_dir=$4&p=$6',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    55
	'/^(email|report|subscribe|unsubscribe)[\/_-]?([0-9]+)(\.html?|\/)?$/i'													=>	'misc.php?$1=$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    56
	'/^(mark|rules)[\/_-]?(read)?(\.html?|\/)?$/i'																			=>	'misc.php?action=$1$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    57
	'/^mark[\/_-](forum)[\/_-]?([0-9]+)[\/_-](read)(\.html?|\/)?$/i'														=>	'misc.php?action=markforumread&fid=$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    58
	'/^help[\/_-]([a-z]+)(\.html?|\/)?$/i'																					=>	'help.php?section=$1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    59
	'/^moderate[\/_-]?([0-9]+)(\.html?|\/)?$/i'																				=>	'moderate.php?fid=$1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    60
	'/^move_topics[\/_-]?([0-9]+)[\/_-]([0-9]+)(\.html?|\/)?$/i'															=>	'moderate.php?fid=$1&move_topics=$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    61
	'/^(open|close|stick|unstick)[\/_-]?([0-9]+)[\/_-]([0-9]+)[\/_-]([a-z0-9]+)(\.html?|\/)?$/i'							=>	'moderate.php?fid=$2&$1=$3&csrf_token=$4',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    62
	'/^moderate[\/_-]?([0-9]+)[\/_-]?p(age)?[\/_-]?([0-9]+)(\.html?|\/)?$/i'												=>	'moderate.php?fid=$1&p=$3',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    63
	'/^moderate[\/_-]?([0-9]+)[\/_-]([0-9]+)(\.html?|\/)?$/i'																=>	'moderate.php?fid=$1&tid=$2',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    64
	'/^moderate[\/_-]?([0-9]+)[\/_-]([0-9]+)[\/_-]?p(age)?[\/_-]?([0-9]+)(\.html?|\/)?$/i'									=>	'moderate.php?fid=$1&tid=$2&p=$4',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    65
	'/^get_host[\/_-]?([0-9]+|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})(\.html?|\/)?$/i'								=>	'moderate.php?get_host=$1',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    66
	'/^admin(\.html?|\/)?$/i'																								=>	'admin/index.php',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    67
	'/^admin[\/_-]([a-z]+)(\.html?|\/)?$/i'																					=>	'admin/$1.php',
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    68
	'/^admin[\/_-]?(options|extensions)[\/_-]([a-z]+)(\.html?|\/)?$/i'														=>	'admin/$1.php?section=$2'
5e1f1e916419 Big upgrade to 1.3 beta. Basic things are working.
Dan
parents:
diff changeset
    69
);