Support Forums

Issue in the _redirects file

My _redirects file has the following rules:

/james https://youtube.com/watch?v=etdj4qtsYN0
/* /index

I have pretty URLs turned on.

But when I try accessing mysite.com/james, instead of redirecting to Youtube, the address bar shows mysite.com/?v=etdj4qtsYN0 and the index page of mysite.com get rendered.

Spent hours trying to figure out what’s going wrong. Please help me out.

Hi @pexeixv

If you look in your deploy log you will likely see something like this

The second rule needs to read

/*  /index

In either case, both with the (correct) /* rule and without the /james redirect worked perfectly.

Hey I’m sorry. My second rule does read /* /index. I missed a / while typing the post. Anything else that could be going wrong?

If you can provide you site URL I can test and see if I have the same issue.

Another option is to try in a different browser or private/incognito window and see if you see the same behaviour.

Hi @pexeixv,

Would you try forcing the rule?

/james https://youtube.com/watch?v=etdj4qtsYN0 301!

# I believe you're trying to use the SPA redirect rule
/* /index.html 200