Topic: rewrite rules
I am trying to make for my extension gallery the sef urls but I am lost, can somebody help me a little?
I am trying this for the last 5 days but i still do not get it, what am I doin wrong!
rewrite_rules.php
<?
$pun_rewrite_rules_gallery = array(
'/^gallery(\.html)?$/i' => 'index.php?gallery',
'/^gallery_album[\/_-]?([0-9]+).*(\.html?|\/)?$/i' => 'index.php?gallery&album=$1'
);
$pun_rewrite_rules = array_merge($pun_rewrite_rules, $pun_rewrite_rules_gallery);
Default.php
<?php
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
$pun_url_gallery = array(
'gallery' => 'index.php?gallery',
'gallery_album' => 'index.php?gallery&album=$1'
);
$pun_url = array_merge($pun_url, $pun_url_gallery);
File_based.php
<?php
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
$pun_url_gallery = array(
'gallery' => 'gallery.html',
'gallery_album' => 'index.html?gallery&album=$1'
);
$pun_url = array_merge($pun_url, $pun_url_gallery);
File_based_(fancy).php
<?php
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
$pun_url_gallery = array(
'gallery' => 'gallery.html',
'gallery/album/' => 'gallery/album_$1.html'
);
$pun_url = array_merge($pun_url, $pun_url_gallery);
Folder_based.php
<?php
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
$pun_url_gallery = array(
'gallery' => 'gallery',
'gallery_album' => 'gallery/album/$1'
);
$pun_url = array_merge($pun_url, $pun_url_gallery);
and the code i use to print my url is:
pun_link ( $pun_url['gallery_album'], array($li_gallery_name, sef_friendly ( $li_gallery_name ) ) )