fix: Start to incorporate lang in URL paths 🌋#704
fix: Start to incorporate lang in URL paths 🌋#704darcywong00 wants to merge 30 commits intoepic/i18n-url-schemefrom
Conversation
User Test ResultsTest specification and instructions User tests are not required |
* These folders don't use _content
1. remove .php / .md 2. redirects before rewrites 3. rewrite locale to lang= parameter 4. final cleanup
7a87423 to
bf9897e
Compare
also cleaned up test pages
| @@ -0,0 +1,4 @@ | |||
| <?php | |||
| // Redirect to Android homepage | |||
| header('Location: https://help.keyman.com/products/android/'); | |||
There was a problem hiding this comment.
Converted from /_content/android/app/.htaccess - also done for iphone-and-ipad/app
Root .htaccess rules weren't matching
There was a problem hiding this comment.
I'm a little uncomfortable with this change -- it might be better to add the rule at the top level .htaccess?
| # Remove .php extension and redirect | ||
| #RewriteCond "$1.php" -f | ||
| #RewriteCond "$1" !-d | ||
| RewriteRule "^(.+).php$" "$1" [R,L] |
There was a problem hiding this comment.
We need the same pattern for Markdown I think
| RewriteRule "^(.+).php$" "$1" [R,L] | |
| RewriteRule "^(.+)\.php$" "$1" [R,L] | |
| RewriteRule "^(.+)\.md$" "$1" [R,L] |
See for example:
http://keyman.com.localhost/en/about/team/bios/darcywong00.md should redirect to http://keyman.com.localhost/en/about/team/bios/darcywong00
| # ------------------------------------------------------------------ | ||
|
|
||
| # Remove index.md or index.php and redirect (and stop processing) | ||
| #RewriteCond "$1" -d |
There was a problem hiding this comment.
| #RewriteCond "$1" -d |
| #RewriteCond "$1.php" -f | ||
| #RewriteCond "$1" !-d |
There was a problem hiding this comment.
| #RewriteCond "$1.php" -f | |
| #RewriteCond "$1" !-d |
|
|
||
| # Remove index.md or index.php and redirect (and stop processing) | ||
| #RewriteCond "$1" -d | ||
| RewriteRule "^((.+)/)?index(.md|.php)?$" "$1" [R,L] |
There was a problem hiding this comment.
| RewriteRule "^((.+)/)?index(.md|.php)?$" "$1" [R,L] | |
| RewriteRule "^((.+)/)?index(\.md|\.php)?$" "$1" [R,L] |
| # ------------------------------------------------------------------ | ||
|
|
||
| # Redirect /archive/downloads.php" | ||
| RewriteRule "^archive/downloads(.php)?$" "/downloads/archive/" [NC,R=301,QSA] |
There was a problem hiding this comment.
| RewriteRule "^archive/downloads(.php)?$" "/downloads/archive/" [NC,R=301,QSA] | |
| RewriteRule "^archive/downloads(.php)?$" "/downloads/archive/" [NC,R=301,END,QSA] |
? I am not sure if END is required for redirects?
| </div> | ||
| <div class="download-cta-small iPad" id="cta-iPad"> | ||
| <a href="../../../ipad/"> | ||
| <a href="../../../../ipad/"> |
| </div> | ||
| <!--<div class="download-cta-small Bookmarklet" id="cta-Bookmarklet"> | ||
| <a href="../../../bookmarklet/"> | ||
| <a href="../../../../bookmarklet/"> |
There was a problem hiding this comment.
| <a href="../../../../bookmarklet/"> | |
| <a href="../../../bookmarklet/"> |
| </p> | ||
| <p> | ||
| <span class="red">A.</span> Yes, you can find the links to download Keyman Desktop 7.1 and other previous releases <a href="../archive/downloads.php">here</a>. | ||
| <span class="red">A.</span> Yes, you can find the links to download Keyman Desktop 7.1 and other previous releases <a href="/archive/downloads">here</a>. |
There was a problem hiding this comment.
| <span class="red">A.</span> Yes, you can find the links to download Keyman Desktop 7.1 and other previous releases <a href="/archive/downloads">here</a>. | |
| <span class="red">A.</span> Yes, you can find the links to download Keyman Desktop 7.1 and other previous releases <a href="../archive/downloads">here</a>. |
Why make the path absolute again?
| // Fallback to 'en' | ||
| // TODO-I18N-URL-SCHEME: integrate with Locale.php | ||
| $fields->lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en'; |
There was a problem hiding this comment.
Why remove this? We'll need something like this throughout
| ## Links to Other Test Pages | ||
|
|
||
| [/go links](./go) | ||
| [/go links](/_test/go) |
Follows #696
This overhauls .htaccess files to handle a langtag in the URL path (rewrite to corresponding _content/ path).
Flow of .htaccess:
Additional small changes:
_content/archive/.htaccessrule to the root .htaccess$fields->langin Foot and Menu from fix: Convert some absolute paths to relative 🌋 #692 since.htaccesshandles the language paramsCI link checker
willmay still failTest-bot: skip