Topic: 1.3 Beta Rewrite

So i'm using the Rewrite function on File_based.

Firstly is anyone aware what the difference between File_based and File_based(Fancy) is?

Oh also i was wondering if anyone knows anything about choosing a custom file extension for the File_based rewrite.

For example:
File_based rewrite default output:
http://www.yoursite.com/punbb/forum1.html

File_based rewrite custom output:
http://www.yoursite.com/punbb/forum1.msf

Don't ask why i want it like that, i just do tongue If anyone knows how to let me know!

Love, HOLLYWOOD.

2 (edited by HOLLYWOOD 2008-06-06 03:27)

Re: 1.3 Beta Rewrite

I edited my rewrite_rules.php and it now looks like this

<?php
/***********************************************************************

  Copyright (C) 2002-2008  PunBB.org

  This file is part of PunBB.

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/


$pun_rewrite_rules = array(
    '/^topic[\/_-]?([0-9]+).*(new|last)[\/_-]?(post)?s?(\.msf?|\/)?$/i'                                                    =>    'viewtopic.php?id=$1&action=$2',
    '/^post[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                                                    =>    'viewtopic.php?pid=$1',
    '/^(forum|topic)[\/_-]?([0-9]+).*[\/_-]p(age)?[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                            =>    'view$1.php?id=$2&p=$4',
    '/^(f|t)(orum|opic)[\/_-]?([0-9]+)[\/_-](rss|atom)(\.msf?|\/)?$/i'                                                        =>    'extern.php?action=feed&$1id=$3&type=$4',
    '/^(forum|topic)[\/_-]?([0-9]+).*(\.msf?|\/)?$/i'                                                                        =>    'view$1.php?id=$2',
    '/^new[\/_-]?reply[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                                        =>    'post.php?tid=$1',
    '/^new[\/_-]?reply[\/_-]?([0-9]+)[\/_-]?quote[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                            =>    'post.php?tid=$1&qid=$2',
    '/^new[\/_-]?topic[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                                        =>    'post.php?fid=$1',
    '/^(delete|edit)[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                                        =>    '$1.php?id=$2',
    '/^(login|search|register)(\.msf?|\/)?$/i'                                                                                =>    '$1.php',
    '/^logout[\/_-]?([0-9]+)[\/_-]([a-z0-9]+)(\.msf?|\/)?$/i'                                                                =>    'login.php?action=out&id=$1&csrf_token=$2',
    '/^request[\/_-]?password(\.msf?|\/)?$/i'                                                                                =>    'login.php?action=forget',
    '/^user[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                                                    =>    'profile.php?id=$1',
    '/^user[\/_-]?([0-9]+)[\/_-]?([a-z]+)(\.msf?|\/)?$/i'                                                                    =>    'profile.php?section=$2&id=$1',
    '/^(change|delete|upload)[\/_-]?(email|pass|avatar|user)(word)?[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                            =>    'profile.php?action=$1_$2&id=$4',
    '/^change[\/_-]?(email|pass)(word)?[\/_-]?([0-9]+)[\/_-]([a-zA-Z0-9]+)(\.msf?|\/)?$/i'                                    =>    'profile.php?action=change_$1&id=$3&key=$4',
    '/^search[\/_-]?(new|recent|unanswered|subscriptions)(\.msf?|\/)?$/i'                                                    =>    'search.php?action=show_$1',
    '/^search[\/_-]?(new|recent|unanswered|subscriptions)[\/_-]p(age)?[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                        =>    'search.php?action=show_$1&p=$3',
    '/^search[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                                                =>    'search.php?search_id=$1',
    '/^search[\/_-]?([0-9]+)[\/_-]?p(age)?[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                    =>    'search.php?search_id=$1&p=$3',
    '/^search[\/_-]?(posts|topics)[\/_-]?user[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                =>    'search.php?action=show_user_$1&user_id=$2',
    '/^search[\/_-]?(posts|topics)[\/_-]?user[\/_-]?([0-9]+)[\/_-]?p(age)?[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                    =>    'search.php?action=show_user_$1&user_id=$2&p=$4',
    '/^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',
    '/^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',
    '/^search-k(.*)-([0-9-]+)-a(.*)-(message|subject|all)-([0-9]+)-(ASC|DESC)-(posts|topics).msf?$/i'                        =>    'search.php?action=search&keywords=$1&author=$3&forum=$2&search_in=$4&sort_by=$5&sort_dir=$6&show_as=$7',
    '/^search-k(.*)-(message|subject|all)-a(.*)-([0-9]+)-(ASC|DESC)-([0-9-]+)-(posts|topics)-p([0-9]+).msf?$/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',
    '/^users(\.msf?|\/)?$/i'                                                                                                =>    'userlist.php',
    '/^users\/(.*)\/([0-9-]+)\/?([a-z_]+)[\/_-]([a-zA-Z]+)[\/_-]p(age)?[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                        =>    'userlist.php?username=$1&show_group=$2&sort_by=$3&sort_dir=$4&p=$6',
    '/^(email|report|subscribe|unsubscribe)[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                    =>    'misc.php?$1=$2',
    '/^(mark|rules)[\/_-]?(read)?(\.msf?|\/)?$/i'                                                                            =>    'misc.php?action=$1$2',
    '/^mark[\/_-](forum)[\/_-]?([0-9]+)[\/_-](read)(\.msf?|\/)?$/i'                                                        =>    'misc.php?action=markforumread&fid=$2',
    '/^help[\/_-]([a-z]+)(\.msf?|\/)?$/i'                                                                                    =>    'help.php?section=$1',
    '/^moderate[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                                                =>    'moderate.php?fid=$1',
    '/^move_topics[\/_-]?([0-9]+)[\/_-]([0-9]+)(\.msf?|\/)?$/i'                                                            =>    'moderate.php?fid=$1&move_topics=$2',
    '/^(open|close|stick|unstick)[\/_-]?([0-9]+)[\/_-]([0-9]+)[\/_-]([a-z0-9]+)(\.msf?|\/)?$/i'                            =>    'moderate.php?fid=$2&$1=$3&csrf_token=$4',
    '/^moderate[\/_-]?([0-9]+)[\/_-]?p(age)?[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                                =>    'moderate.php?fid=$1&p=$3',
    '/^moderate[\/_-]?([0-9]+)[\/_-]([0-9]+)(\.msf?|\/)?$/i'                                                                =>    'moderate.php?fid=$1&tid=$2',
    '/^moderate[\/_-]?([0-9]+)[\/_-]([0-9]+)[\/_-]?p(age)?[\/_-]?([0-9]+)(\.msf?|\/)?$/i'                                    =>    'moderate.php?fid=$1&tid=$2&p=$4',
    '/^get_host[\/_-]?([0-9]+|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})(\.msf?|\/)?$/i'                                =>    'moderate.php?get_host=$1',
    '/^admin(\.msf?|\/)?$/i'                                                                                                =>    'admin/index.php',
    '/^admin[\/_-]([a-z]+)(\.msf?|\/)?$/i'                                                                                    =>    'admin/$1.php',
    '/^admin[\/_-]?(options|extensions)[\/_-]([a-z]+)(\.msf?|\/)?$/i'                                                        =>    'admin/$1.php?section=$2'
);

Now when i goto the forum all the links are .html, but if i click on the links it comes up with bad request. BUT if i navigate to: http://www.yoursite.com/punbb/forum1.msf it works.
How to i get all the page links to goto a .msf extension?

Re: 1.3 Beta Rewrite

You should not edt that file, you can edit the files in the folder url to what you want the link to look like.

Re: 1.3 Beta Rewrite

Like.... Every single PunBB file with .html links? Oh and why shouldn't i edit that file?