Closed Bug 954366 Opened 11 years ago Closed 11 years ago

Categories

(Instantbird Servers Graveyard :: www.instantbird.com, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bugzilla, Assigned: florian)

References

()

Details

Attachments

(1 file, 1 obsolete file)

*** Original post on bio 933 by Michal Stanke <michal.stanke AT mikk.cz> at 2011-07-17 07:32:00 UTC ***

Direct links to localized websites are not working without the ending slash http://(www.)instantbird.com/'lang' .
Websites are avaible only on http://(www.)instantbird.com/'lang'/ .
*** Original post on bio 933 at 2011-07-17 07:46:10 UTC ***

I'm seeing this (checked with http://www.instantbird.com/de ): confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch patch v1 (obsolete) — Splinter Review
*** Original post on bio 933 as attmnt 769 by michal.stanke AT mikk.cz at 2011-08-03 11:44:00 UTC ***

I've found this by the method of "trial and error".

I am not sure about details of it's functionality. I have tested it and it works with as well as without the ending slash.
But I don't know all the cases, when this rule is used.

So please test it.
Attached patch patch v2Splinter Review
*** Original post on bio 933 as attmnt 770 by michal.stanke AT mikk.cz at 2011-08-03 12:16:00 UTC ***

I'm sorry, this is the right one.
Comment on attachment 8352511 [details] [diff] [review]
patch v1

*** Original change on bio 933 attmnt 769 by michal.stanke AT mikk.cz at 2011-08-03 12:16:04 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352511 - Attachment is obsolete: true
Comment on attachment 8352512 [details] [diff] [review]
patch v2

*** Original change on bio 933 attmnt 770 by michal.stanke AT mikk.cz at 2011-08-03 14:05:16 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352512 - Flags: review?
Severity: minor → normal
Comment on attachment 8352512 [details] [diff] [review]
patch v2

*** Original change on bio 933 attmnt 770 at 2011-10-15 23:46:08 UTC ***

>--- a/.htaccess
>+++ b/.htaccess
>@@ -1,6 +1,7 @@
> RewriteEngine on
> 
> RewriteRule ^([a-z0-9.-]+)\.html?$ $1.php [L]
>+RewriteRule ^([a-zA-Z]{2}(-[a-zA-Z]{2})?)/?$(.*)?$ $3?lang=$1 [L]

$ in the regexp means "match the end of the string" so (.*)?$ is useless here.

You don't need to match the ending slash either, as it's already matched by the next rule, so /? isn't useful either.

So your rewrite rule can be simplified to:

RewriteRule ^([a-zA-Z]{2}(-[a-zA-Z]{2})?)$ ?lang=$1 [L]


However, I don't think the URLs without the ending slash are valid, so rather than accepting them, I think we should redirect to the correct address instead, so I suggest using this rule instead:

RewriteRule ^([a-zA-Z]{2}(-[a-zA-Z]{2})?)$ $1/ [R]
Attachment #8352512 - Flags: review? → review-
*** Original post on bio 933 at 2011-10-15 23:55:57 UTC ***

(In reply to comment #4)

> I think we should redirect to the correct address instead,
> so I suggest using this rule instead:
> 
> RewriteRule ^([a-zA-Z]{2}(-[a-zA-Z]{2})?)$ $1/ [R]

Done this in https://hg.instantbird.org/websites/www.instantbird.com/rev/4e92fd6944e0

Resolving as FIXED. (You can verify that this is fixed on the staging server, the fix will be on the real www.instantbird.com website when we will release Instantbird 1.1).
Assignee: nobody → florian
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
*** Original post on bio 933 at 2011-10-16 00:01:42 UTC ***

Oh, and I forgot in my previous comment: thanks for reporting this and providing a patch! :-) (and sorry for the delay in getting back to fixing this...)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: