Closed Bug 471834 Opened 12 years ago Closed 11 years ago

Move rewrites from *.add-ons.mozilla.com vhost block to AMO (in order to support app version numbers in URLs)

Categories

(addons.mozilla.org Graveyard :: Public Pages, defect, P3)

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: reed, Unassigned)

References

()

Details

I'm trying to fix bug 454300 in Firefox and other places, but it's hard when AMO doesn't support the format I want, so I'm kinda blocked on some stuff working correctly for AMO. Instead of adding to the mess of rewrites in the add-ons.mozilla.com vhost, I'd like to move stuff directly to AMO's .htaccess and routes.php...

Current vhost block for *.add-ons.mozilla.com:
<VirtualHost *:80>
    ServerName addons.mozilla.com
    ServerAlias *.add-ons.mozilla.com *.add-ons.mozilla.org do-not-add.mozilla.org add-ons.mozilla.com
    RewriteEngine On
    RewriteRule ^/ja(?:-JP-mac)?/(firefox)(.*)$ https://addons.mozilla.jp/$1$2 [R=permanent,QSA,NE]
    RewriteRule ^/(\w{2,3}(?:-\w{2}(?:-mac)?)?)/thunderbird/(.+?)/dictionaries/?$ https://addons.mozilla.org/thunderbird/dictionari
es/?lang=$1 [R,L]
    RewriteRule ^/(\w{2,3}(?:-\w{2}(?:-mac)?)?)/seamonkey/(.+?)/dictionaries/?$ https://addons.mozilla.org/$1/seamonkey/browse/type
:3 [R,L]
    RewriteRule ^/(\w{2,3}(?:-\w{2}(?:-mac)?)?)/(.+?)/(.+?)/dictionaries/?$ https://addons.mozilla.org/firefox/dictionaries/?lang=$
1 [R,L]
    RewriteRule ^/(ca|cs|da|de|en-US|el|es-ES|eu|fa|fi|fr|ga-IE|he|id|it|ja|ko|mn|nl|pl|pt-BR|pt-PT|ro|ru|sk|sq|sv-SE|uk|zh-CN|zh-T
W|cy|tr|vi)/(.+?)/(\d.+?)/search-engines/?$ https://addons.mozilla.org/$1/firefox/browse/type:4/cat:all?sort=name [R,L]
    RewriteRule ^/(\w{2,3}(-\w{2}(-mac)?)?)/(.+?)/(.+?)/search-engines/?$ https://addons.mozilla.org/en-US/firefox/browse/type:4/ca
t:all?sort=name [R,L]
    RewriteRule ^/(ca|cs|da|de|en-US|el|es-ES|eu|fa|fi|fr|ga-IE|he|id|it|ja|ko|mn|nl|pl|pt-BR|pt-PT|ro|ru|sk|sq|sv-SE|uk|zh-CN|zh-T
W|cy|tr|vi)/(.+?)/(\d.+?)/(.*)$ https://addons.mozilla.org/$1/$2/$4 [R,L]
    RewriteRule ^/(ca|cs|da|de|en-US|el|es-ES|eu|fa|fi|fr|ga-IE|he|id|it|ja|ko|mn|nl|pl|pt-BR|pt-PT|ro|ru|sk|sq|sv-SE|uk|zh-CN|zh-T
W|cy|tr|vi)(/.*)?$ https://addons.mozilla.org/$1$2 [R,NE,L]
    RewriteRule ^/(\w{2,3}(-\w{2}(-mac)?)?)/?$ https://addons.mozilla.org/ [R]
    RewriteRule ^/(\w{2,3}(-\w{2}(-mac)?)?)/firefox/bookmarks/?$ https://addons.mozilla.org/firefox/bookmarks/ [R,L]
    RewriteRule ^/(\w{2,3}(-\w{2}(-mac)?)?)/(.+?)/(.+?)/(.*)$ https://addons.mozilla.org/$4/$6 [R,L,NE]
    RewriteRule ^/(\w{2,3}(-\w{2}(-mac)?)?)/(.*)$ https://addons.mozilla.org/$4 [R,NE]
    Redirect temp / https://addons.mozilla.org/
    
</VirtualHost>

URLs that need to work but don't currently:
* https://addons.mozilla.org/en-US/firefox/3.0.5/dictionaries/
* https://addons.mozilla.org/en-US/firefox/3.0.5/extensions/
* https://addons.mozilla.org/en-US/firefox/3.0.5/themes/
* https://addons.mozilla.org/en-US/firefox/3.0.5/plugins/
* https://addons.mozilla.org/en-US/firefox/3.0.5/search-engines/

I'm willing to help write a patch if somebody wants to help me decide how best to implement this, whether as .htaccess rewrites or routes.php stuff or something else. Thanks!
Summary: Support app version numbers in URLs and redirect appropriately → Move rewrites from *.add-ons.mozilla.com vhost block to AMO (in order to support app version numbers in URLs)
We're not using the version anywhere else on AMO, do we really need it here?

Those URLs (without the versions) are handled by routes.php and the legacy_url controller.  I don't think you can "connect" urls via regex in routes.php though and I don't want to add a big loop.  If you really need the version you could use the .htaccess to rewrite it along the lines of:

a.m.o/en-US/firefox/dictionaries/?version=3.0.5
Blocks: 497072
Is there any progress on this? I just filed bug 497072 on the SeaMonkey client URLs as the ones we used so far (*.add-ons.mozilla.org) even throw cert errors at the user, and it would be good to know what URLs we should switch to.
What's the status of this?  Still needed?

Robert:  I'd rather not use *.a.m.o at all.  We're finally moving away from the locale based domains on moz.com and I'd like to follow suit here.
Priority: -- → P3
Target Milestone: --- → Future
(In reply to comment #3)
> What's the status of this?  Still needed?

Yes, I'm blocked fixing bug 454300 on it. We could possibly take out versions completely, but that might be bad...
I'm just going to remove the version....
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
(In reply to comment #3)
> Robert:  I'd rather not use *.a.m.o at all.  We're finally moving away from the
> locale based domains on moz.com and I'd like to follow suit here.

I fully agree here, we're trying to follow what Firefox et al. are doing, but we thought we should stay with .org as .com is not really community-project-oriented. In any case, for SeaMonkey 2.0, we switched to the same .com addresses as Firefox has to avoid the cert error pages.
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.