Create complex redirect

Hi all,

Is it possible to establish this redirection?

site_root/folder_name/#string --> site_root/folder_name/string/

Hi there, are you trying to be able to create that specific redirect, or is this actually a question regarding creating nicer urls? :thinking:


I’m triying to create that redirect. We have migrated our current website from Worpress to Jekyll and need to redirect some old URLs to the ones we have created in the new website.

Hey @DrFalken,
Our redirects don’t do any kind regex matching if that’s what you’re asking, so I believe the answer to this is no- you’d need something that would generate the correct “to” path string based on the “from” path string, and we don’t that. If the issue is a # character before every file name, I’d recommend writing a script to rename all your files with the character stripped out, and then uploading to Netlify.

Hi Jen,

I don’t think I need to use regex, I just want to set up four fixed redirects with the URL structure I mentioned. I tried to set one but when I go to the initial URL I get a 404 error instead of running the redirect

Hey @DrFalken,

I’ve tried to reproduce this and, as Jen states, it’s not going to be possible. I’ve also consulted our internal team who advise that use of hashes in this manner isn’t in accordance with the HTTP spec. Therefore, the URL itself will not be recognised as a URL and any redirect rules would fail to work.

I’m sorry that we don’t have better news for you however all is not lost! It would be possible to strip the hashes from the old site (or handle them in another, spec-approved manner) to get this project up-and-running.

Ok, thank you for your time.