2006-01-18 13:11:04 +03:00
|
|
|
# a) Install me in public/htdocs/.htaccess, or
|
|
|
|
# b) Create a <Directory> entry in your Apache conf
|
|
|
|
|
|
|
|
# You MUST define YOURPATH/inc as an include_path!
|
|
|
|
php_value include_path /YOURPATH/v2/public/inc:.:/usr/share/pear:/YOURPATH/v2/shared/lib
|
|
|
|
|
|
|
|
# Init script to set up required libraries.
|
|
|
|
php_value auto_prepend_file init.php
|
|
|
|
|
|
|
|
# Finish script that calls $tpl->display for global Smarty object.
|
|
|
|
php_value auto_append_file finish.php
|
2006-01-30 05:27:11 +03:00
|
|
|
|
|
|
|
# Rewrite engine must be used to simplify URLs so they are human readable.
|
|
|
|
RewriteEngine On
|
|
|
|
RewriteBase /YOURPATH/public/htdocs
|
|
|
|
|
2006-04-05 06:28:57 +04:00
|
|
|
# Rewrites to be compatible with older versions of addons.
|
|
|
|
RewriteRule ^update/VersionCheck.php(.*)$ update.php$1
|
|
|
|
RewriteRule ^extensions/moreinfo.php(.*)$ addon.php$1
|
|
|
|
RewriteRule ^themes/moreinfo.php(.*)$ addon.php$1
|
|
|
|
RewriteRule ^rss/index.php(.*)$ rss.php$1
|
|
|
|
|
2006-04-02 11:24:27 +04:00
|
|
|
# Compatiblity for v1 of extensions. The hardcoded URL's in the old
|
|
|
|
# browsers need this to get to the right pages: (the strings are the GUIDs)
|
|
|
|
# Old example URL:
|
|
|
|
# /extensions/?application={3550f703-e582-4d05-9a08-453d09bdfdc6}
|
|
|
|
# New:
|
|
|
|
# /extensions.php?app={3550f703-e582-4d05-9a08-453d09bdfdc6}
|
|
|
|
RewriteCond %{REQUEST_URI} /extensions/
|
|
|
|
RewriteCond %{QUERY_STRING} ^application=(.*)$
|
|
|
|
RewriteRule ^.*$ extensions.php?app=%1 [L]
|
|
|
|
|
|
|
|
# Compatiblity for v1 of extensions. The hardcoded URL's in the old
|
|
|
|
# browsers need this to get to the right pages: (the strings are the GUIDs)
|
|
|
|
# Old example URL:
|
|
|
|
# /themes/?application={3550f703-e582-4d05-9a08-453d09bdfdc6}
|
|
|
|
# New:
|
|
|
|
# /themes.php?app={3550f703-e582-4d05-9a08-453d09bdfdc6}
|
|
|
|
RewriteCond %{REQUEST_URI} /themes/
|
|
|
|
RewriteCond %{QUERY_STRING} ^application=(.*)$
|
|
|
|
RewriteRule ^.*$ themes.php?app=%1 [L]
|
|
|
|
|
2006-01-30 05:27:11 +03:00
|
|
|
# Send rss/* to rss.php.
|
|
|
|
# Example:
|
|
|
|
# /rss/firefox/extensions/popular/ -> rss.php?app=firefox&type=extensions&list=popular
|
|
|
|
RewriteRule ^rss/(\w+)/(\w+)/(\w+)[/]{0,1}$ rss.php?app=$1&type=$2&list=$3
|
|
|
|
|
|
|
|
# Rewrite to addon.php if all we have is a numerical id after appname.
|
|
|
|
# Example:
|
|
|
|
# /firefox/220/ -> addon.php?app=firefox&id=220
|
|
|
|
RewriteRule ^(\w+)/(\d+)[/]{0,1}$ addon.php?app=$1&id=$2
|
|
|
|
|
|
|
|
# Rewrite to an addon-specific page, passing app and id.
|
|
|
|
# Example:
|
|
|
|
# /firefox/220/previews/ -> previews.php?app=firefox&id=220
|
|
|
|
RewriteRule ^(\w+)/(\d+)/(\w+)[/]{0,1}$ $3.php?app=$1&id=$2
|
|
|
|
|
|
|
|
# Rewrite to addon.php if there is a name given plus overview (special case for addon.php).
|
|
|
|
# Example:
|
|
|
|
# /firefox/flashgot/overview/ -> addon.php?app=firefox&name=flashgot
|
|
|
|
RewriteRule ^(\w+)/(\w+)/overview[/]{0,1}$ addon.php?app=$1&name=$2
|
|
|
|
|
|
|
|
# Rewrite to addon-specific page, passing app and addon name.
|
|
|
|
# Example:
|
|
|
|
# /firefox/flashgot/previews/ -> previews.php?app=firefox&name=flashgot
|
|
|
|
RewriteRule ^(\w+)/(\w+)/(\w+)[/]{0,1}$ $3.php?app=$1&name=$2
|
|
|
|
|
|
|
|
# Rewrite top-level pages.
|
|
|
|
# Examples:
|
|
|
|
# /firefox/extensions/ -> extensions.php?app=firefox
|
|
|
|
# /firefox/themes/ -> themes.php?app=firefox
|
|
|
|
RewriteRule ^(\w+)/([\w-]+)[/]{0,1}$ $2.php?app=$1
|
|
|
|
|
|
|
|
# Rewrite for main page & app.
|
|
|
|
# Example:
|
|
|
|
# /firefox/ -> /?app=firefox
|
|
|
|
RewriteRule ^(\w+)[/]{0,1}$ index.php?app=$1
|