File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,15 @@ export function middleware(request: NextRequest) {
4848 if ( pathWithoutBase . startsWith ( `/v/${ docsConfig . DOCS_LATEST_VERSION } /` ) ) {
4949 return NextResponse . redirect ( createRedirectUrl (
5050 request ,
51- `https://sourcegraph.com/docs/:slug*` ,
52- pathWithoutBase
51+ pathWithoutBase . substring ( `/v/ ${ docsConfig . DOCS_LATEST_VERSION } /` . length - 1 ) ,
52+ ""
5353 ) )
5454 }
5555 if ( pathWithoutBase . startsWith ( `/@${ docsConfig . DOCS_LATEST_VERSION } /` ) ) {
5656 return NextResponse . redirect ( createRedirectUrl (
5757 request ,
58- `https://sourcegraph.com/docs/:slug*` ,
59- pathWithoutBase
58+ pathWithoutBase . substring ( `/@ ${ docsConfig . DOCS_LATEST_VERSION } /` . length - 1 ) ,
59+ ""
6060 ) )
6161 }
6262 const versionMatch = pathWithoutBase . match ( / ^ \/ v \/ ( \d + \. \d + ) \/ ( .* ) / )
You can’t perform that action at this time.
0 commit comments