mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 00:25:27 +00:00
78 lines
3.0 KiB
Plaintext
78 lines
3.0 KiB
Plaintext
# 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
|
|
|
|
# Rewrite engine must be used to simplify URLs so they are human readable.
|
|
RewriteEngine On
|
|
RewriteBase /YOURPATH/public/htdocs
|
|
|
|
# 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
|
|
|
|
# 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]
|
|
|
|
# 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
|