Skip to content

Commit

Permalink
Fixed incorrect redirections (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericsimard authored Aug 28, 2024
1 parent 8cdc6c1 commit 531ed7d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Redirect for simple redirections
Redirect 301 /schedule/reference/ /documentation/schedule/reference/
Redirect 301 /schedule/best-practices/ /documentation/schedule/GTFS%20schedule%20best%20Practices/
Redirect 301 /schedule/examples/ /documentation/overview/
Redirect 301 /schedule/example-feed/ /getting_started/example_feed/
Redirect 301 /schedule/examples/routes-stops-trips/ /documentation/schedule/examples/routes-stops-trips/
Redirect 301 /schedule/examples/continuous-stops/ /documentation/schedule/examples/continuous-stops/
Expand All @@ -15,21 +14,20 @@ Redirect 301 /schedule/examples/translations/ /documentation/schedule/examples/t
Redirect 301 /schedule/examples/feed-info/ /documentation/schedule/examples/feed-info/
Redirect 301 /schedule/examples/attributions/ /documentation/schedule/examples/attributions/
Redirect 301 /schedule/examples/flex/ /documentation/schedule/examples/flex/
Redirect 301 /schedule/examples/ /documentation/overview/
Redirect 301 /schedule/changes/ /documentation/schedule/change_history/recent_additions/
Redirect 301 /schedule/process/ /community/governance/gtfs_schedule_amendment_process/
Redirect 301 /schedule/validate/ /getting_started/validate/
Redirect 301 /schedule/publishing/ /getting_started/publish/
Redirect 301 /realtime/ /documentation/overview/
Redirect 301 /realtime/reference/ /documentation/realtime/reference/
Redirect 301 /realtime/best-practices/ /documentation/realtime/realtime_best_practices/
Redirect 301 /realtime/feed-entities/ /documentation/realtime/feed_entities/overview/
Redirect 301 /realtime/feed-entities/trip-updates/ /documentation/realtime/feed_entities/trip-updates/
Redirect 301 /realtime/feed-entities/service-alerts/ /documentation/realtime/feed_entities/service-alerts/
Redirect 301 /realtime/feed-entities/vehicle-positions/ /documentation/realtime/feed_entities/vehicle-positions/
Redirect 301 /realtime/feed-entities/trip-modifications/ /documentation/realtime/feed_entities/trip-modifications/
Redirect 301 /realtime/feed-examples/ /documentation/overview/
Redirect 301 /realtime/feed-examples/trip-updates/ /documentation/realtime/examples/trip-updates/
Redirect 301 /realtime/feed-examples/service-alerts/ /documentation/realtime/examples/service-alerts/
Redirect 301 /realtime/feed-examples/ /documentation/overview/
Redirect 301 /realtime/proto/ /documentation/realtime/proto/
Redirect 301 /realtime/language-bindings/ /documentation/realtime/language-bindings/overview/
Redirect 301 /realtime/language-bindings/dotnet/ /documentation/realtime/language-bindings/dotnet/
Expand All @@ -42,9 +40,9 @@ Redirect 301 /realtime/language-bindings/php/ /documentation/realtime/language-b
Redirect 301 /realtime/changes/ /documentation/realtime/change_history/recent_additions/
Redirect 301 /realtime/process/ /community/governance/gtfs_realtime_amendment_process/
Redirect 301 /resources/community/ /community/get_involved/
Redirect 301 /extensions/ /community/extensions/overview/
Redirect 301 /extensions/fares-v2/ /community/extensions/fares-v2/
Redirect 301 /extensions/flex/ /community/extensions/flex/
Redirect 301 /extensions/ /community/extensions/overview/

# Turn the rewrite engine on for the rest
RewriteEngine On
Expand All @@ -53,6 +51,14 @@ RewriteEngine On
RewriteCond %{REQUEST_URI} ^/resources/$
RewriteRule ^resources/$ /resources/overview/ [L,R=301]

# Redirect /realtime/ to /documentation/overview/ only if the URL is exactly /realtime/
RewriteCond %{REQUEST_URI} ^/realtime/$
RewriteRule ^realtime/$ /documentation/overview/ [L,R=301]

# Redirect /realtime/reference/ to /documentation/realtime/reference/ only if the URL is exactly /realtime/reference/
RewriteCond %{REQUEST_URI} ^/realtime/reference/$
RewriteRule ^realtime/reference/$ /documentation/realtime/reference/ [L,R=301]

# Anchor redirections
RewriteRule ^realtime/process/#guiding-principles https://gtfs.org/community/governance/gtfs_realtime_amendment_process/#guiding-principles [R=301,NE]
RewriteRule ^realtime/process/#revision-history https://gtfs.org/documentation/realtime/change_history/revision_history/ [R=301]
Expand Down

0 comments on commit 531ed7d

Please sign in to comment.