Status

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bugzilla, Assigned: florian)

Tracking

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

325 bytes, patch
florian
: review-
Details | Diff | Splinter Review
(Reporter)

Description

5 years ago
*** 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
(Reporter)

Comment 2

5 years ago
Created attachment 8352511 [details] [diff] [review]
patch v1

*** 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.
(Reporter)

Comment 3

5 years ago
Created attachment 8352512 [details] [diff] [review]
patch v2

*** 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.
(Reporter)

Comment 4

5 years ago
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
(Reporter)

Comment 5

5 years ago
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?
(Reporter)

Updated

5 years ago
Severity: minor → normal
(Assignee)

Comment 6

5 years ago
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-
(Assignee)

Comment 7

5 years ago
*** 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
Last Resolved: 5 years ago
Resolution: --- → FIXED
(Assignee)

Comment 8

5 years ago
*** 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.