RT Apache "hack" - updated version

In reference to “Short URLs to retrieve Ticket numbers and Queues” on the
“Extending RT” page of the “RT Hackers Guide”:

The additions needed to your RT’s VirtualHost configuration are:
RewriteEngine On

Treat a single number as a ticket number:

RewriteRule ^/([0-9]+)$ /Ticket/Display.html?id=$1 [L]

Treat anything else that doesn’t look like a file or directory as

a queue name:

RewriteRule ^/([^/.]+)$ /Search/Listing.html?ShowQueue=$1 [L]

These instructions are out of date and do not work properly with the
current version of RT (2.0.15, as far as I am aware).

Here is the .htaccess file that I am using successfully at the moment,
which achieves much the same results:

RewriteEngine On

Treat a single number as a ticket number:

RewriteRule ^([0-9]+)$ /rt/Ticket/Display.html?id=$1 [L,R]

“new” is an alias for “search for new, unowned tickets”

RewriteRule ^new$ /rt/Search/Listing.html?NewSearch=1&TicketsSortBy=Status&TicketsSortOrder=ASC&StatusOp==&ValueOfStatus=new&OwnerOp==&ValueOfOwner=Nobody [L,R]

Treat anything else that doesn’t look like a file or directory as

a queue name:

RewriteRule ^([^/.]+)$ /rt/Search/Listing.html?NewSearch=1&TicketsSortBy=Status&TicketsSortOrder=ASC&QueueOp==&ValueOfQueue=$1 [L,R]

I presume that Search/Listing.html no longer accepts ShowQueue as an
argument; certainly it did not seem to do anything. In addition, it was
necessary to use the [R] flag to avoid breaking some of the relative links
on the pages.

The “new” alias is just an extra that I find handy.

Please cc me on any replies; I am not a list member. Many thanks to all
who have put together RT - we’ve been using it for three days now and it’s
boosted our productivity to unrecognisable levels. Congratulations on a
great piece of software!

Michael Brown
Fen Systems Ltd.

Michael Brown wrote:

In reference to “Short URLs to retrieve Ticket numbers and Queues” on the
“Extending RT” page of the “RT Hackers Guide”:

These instructions are out of date and do not work properly with the
current version of RT (2.0.15, as far as I am aware).

Hmm.

I presume that Search/Listing.html no longer accepts ShowQueue as an
argument; certainly it did not seem to do anything. In addition, it was
necessary to use the [R] flag to avoid breaking some of the relative links
on the pages.

You’re correct about the [R]. Doco has been updated.

As to The ShowQueue stuff, on the other hand, it’s always required a
patch to Search/Listing, which seems to have been forgotten when the
Hackers Guide article was written. See

http://lists.fsck.com/pipermail/rt-users/2002-April/007593.html

(linked from the Hackers Guide article) for the details.

Personally, I find that cleaner than the RewriteRule you propose;
however, your rule has the advantage of requiring no RT changes. I
guess there’s room for both in the Guide. :slight_smile:

The “new” alias is just an extra that I find handy.

Cute.

�|� Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.