This repository was archived by the owner on Oct 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
URL Rewriting
eksopl edited this page Mar 3, 2012
·
5 revisions
LOCATION_HTTP in board-config.pl changes how fuuka outputs URLs. It defaults to $ENV{SCRIPT_NAME}, which is the full path to the cgi-board.pl. You can make URLs better by adjusting this constant and applying some mod_rewrite rules.
- Edit LOCATION_HTTP. Change it to the desired root of your archive, but don't include a trailing slash. For example, if you want to have URLs like http://archive.example.com/a/, use an empty string (
''). If you want to have URLs like http://example.com/archive/a/, use'/archive' - Add the following rule to your .htaccess. Adjust accordingly,
RewriteBaseneeds to be set to the same thing as LOCATION_HTTP (but with a trailing slash).
DirectoryIndex cgi-board.pl index.html index.php
RewriteEngine On
RewriteBase /archive/
RewriteRule ^(a|jp|m|tg)(/|$)(.*)? cgi-board.pl/$1/$3 [NC,L]
You can omit it altogether if you're running the archive on the root dir:
DirectoryIndex cgi-board.pl index.html index.php
RewriteEngine On
RewriteRule ^(a|jp|m|tg)(/|$)(.*)? cgi-board.pl/$1/$3 [NC,L]
For lighttpd, the syntax is as follow:
url.rewrite-once = ( "^/(a|jp|m|tg)(/?)(.*)?" => "/cgi-board.pl/$1$2$3" )
All that is shown here is how to hide cgi-board.pl from your URLs. Further URL prettifying should be possible with more intricate rewrite rules.