How can I pass an entire URL, with filenames and query parameters, as a single prop in Vue Router?

I’m working on a website that essentially functions the same as the Internet Archive’s Wayback Machine, storing backups of entire websites. The Wayback Machine’s URLs for backups look like this:

https://web.archive.org/web/20051222052158/http://www.lego.com/eng/bionicle/story/2004/cityguide/default.asp?page=home

Note that the URL ends with a filename and a query parameter, and that URL will still take you to a page on the Wayback Machine wrapping default.asp, not directly to the webpage at default.asp.

At present, my router path for the page with this same functionality looks like this:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> {
path: "/wayback",
name: "wayback",
component: () => import("../views/WaybackView.vue"),
alias: [
"/wayback/",
"/wayback/index",
"/wayback/index.html",
"/wayback/index.htm",
"/wayback/index.php",
],
},
{
path: "/wayback/:datetime/:originalurl(.*)?",
name: "wayback",
component: () => import("../views/WaybackView.vue"),
props: (route) => ({
datetime: route.params.datetime,
originalurl: route.params.originalurl,
}),
alias: [
"/wayback/:datetime/:originalurl(.*)?/",
"/wayback/:datetime/:originalurl(.*)?/index",
"/wayback/:datetime/:originalurl(.*)?/index.html",
"/wayback/:datetime/:originalurl(.*)?/index.htm",
"/wayback/:datetime/:originalurl(.*)?/index.php",
],
},
</code>
<code> { path: "/wayback", name: "wayback", component: () => import("../views/WaybackView.vue"), alias: [ "/wayback/", "/wayback/index", "/wayback/index.html", "/wayback/index.htm", "/wayback/index.php", ], }, { path: "/wayback/:datetime/:originalurl(.*)?", name: "wayback", component: () => import("../views/WaybackView.vue"), props: (route) => ({ datetime: route.params.datetime, originalurl: route.params.originalurl, }), alias: [ "/wayback/:datetime/:originalurl(.*)?/", "/wayback/:datetime/:originalurl(.*)?/index", "/wayback/:datetime/:originalurl(.*)?/index.html", "/wayback/:datetime/:originalurl(.*)?/index.htm", "/wayback/:datetime/:originalurl(.*)?/index.php", ], }, </code>
    {
      path: "/wayback",
      name: "wayback",
      component: () => import("../views/WaybackView.vue"),
      alias: [
        "/wayback/",
        "/wayback/index",
        "/wayback/index.html",
        "/wayback/index.htm",
        "/wayback/index.php",
      ],
    },
    {
      path: "/wayback/:datetime/:originalurl(.*)?",
      name: "wayback",
      component: () => import("../views/WaybackView.vue"),
      props: (route) => ({
        datetime: route.params.datetime,
        originalurl: route.params.originalurl,
      }),
      alias: [
        "/wayback/:datetime/:originalurl(.*)?/",
        "/wayback/:datetime/:originalurl(.*)?/index",
        "/wayback/:datetime/:originalurl(.*)?/index.html",
        "/wayback/:datetime/:originalurl(.*)?/index.htm",
        "/wayback/:datetime/:originalurl(.*)?/index.php",
      ],
    },

This only sort of provides the intended functionality — at present, it only works if you end the full URL with a trailing slash, and include no query parameters of any kind. So

wayback/2005/http://www.lego.com/eng/bionicle/story/2004/cityguide/default.asp/

works just fine, but

wayback/2005/http://www.lego.com/eng/bionicle/story/2004/cityguide/default.asp

wayback/2005/http://www.lego.com/eng/bionicle/story/2004/cityguide/default.asp?page=home/

and the actually accurate

wayback/2005/http://www.lego.com/eng/bionicle/story/2004/cityguide/default.asp?page=home

do not work at all — they all just lead to a blank gray screen, without even giving me an error in the console other than a simple 404. This is obviously a problem, as it means I can’t actually use the correct URL for my own archive, and I’m completely unable to archive pages that relied on query parameters, as they don’t work even if they’re inside a (still incorrect) trailing slash.

I have tried manually appending query strings after the router does its work, so

wayback/2005/http://www.lego.com/eng/bionicle/story/2004/cityguide/default.asp/?page=home

sorta works, but it’s still not accurate to the original URL of the page, and of course requires extra work.

So how can I make Vue Router pass everything after :datetime/ in as the originalurl param, ignoring any filenames, query strings, trailing slashes or lack thereof, et cetera?

If this requires modifications to the code of Vue Router itself, I can live with that for the sake of historical accuracy, though it’s definitely not preferable.

Thank you in advance for any help.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật