File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ import { NextResponse } from 'next/server'
6
6
* @returns {NextResponse | undefined }
7
7
*/
8
8
export function middleware ( request ) {
9
+ if ( request . nextUrl . pathname === '/exists-but-not-routed' ) {
10
+ return NextResponse . rewrite ( new URL ( '/dashboard' , request . url ) )
11
+ }
12
+
9
13
if ( request . nextUrl . pathname === '/middleware-to-dashboard' ) {
10
14
return NextResponse . rewrite ( new URL ( '/dashboard' , request . url ) )
11
15
}
Original file line number Diff line number Diff line change
1
+ export async function getServerSideProps ( ) {
2
+ return {
3
+ props : {
4
+ message : 'Hello World!' ,
5
+ } ,
6
+ }
7
+ }
8
+
9
+ export default function Page ( { message } ) {
10
+ return (
11
+ < >
12
+ < p > hello from exists but not routed { message } </ p >
13
+ </ >
14
+ )
15
+ }
Original file line number Diff line number Diff line change
1
+ import Link from 'next/link'
2
+
3
+ export default function Page ( props ) {
4
+ return (
5
+ < >
6
+ < Link href = "/exists-but-not-routed" >
7
+ < a id = "link-to-rewritten-path" > Exists but not routed</ a >
8
+ </ Link >
9
+ </ >
10
+ )
11
+ }
You can’t perform that action at this time.
0 commit comments