mysite.com is the domain that I’ll be forwarding to Softr, but there are forwarder routes on my existing website that I don’t want to disturb. I’ve set up a separate subdomain for those, now I need to ensure that the links don’t break.
The URL redirects feature enables me to redirect one internal route to another internal route.
As I tried to explain using the examples, I want to forward routes with a custom path component to another subdomain entirely.
Let me try.
Let’s say mysite.com is the domain that I’m planning to use for my Softr site. It is currently pointing to my own servers, where I have custom routing set up to handle any URL that follows the mysite.com/forward/<any_variable_here> pattern. Such links correspond to custom pages that generate dynamic content based on the variable in the URL. When I change the domain to Softr, I don’t want to break the routing logic for these links of my app, so I have set up a subdomain forward.mysite.com and pointed it to my own server, which will handle the links that previously followed the mysite.com/forward pattern.
So now I just have to find a way for Softr to forward the old routes to the new ones. Here are some more examples:
mysite.com/forward/abcd1234 should be routed to forward.mysite.com/abcd1234
mysite.com/forward/wxyz7890 should be routed to forward.mysite.com/wxyz7890
mysite.com/forward/foobar should be routed to forward.mysite.com/foobar
There are a couple of different ways to solve this.
You didn’t say whether you have a specific list of redirects, or whether you need to create a rule where mysite.com/forward/<anything> will properly redirect.
The first thing I would try is to approach Softr support (use the chat feature in the studio) and ask them if they can set this up for you. I know that they have the ability to load in a long list of specific redirects, but if you are looking for a redirect rule, they may not be able to help with that.
The other way you might be able to get this to work is to create a Softr page for each redirect, and then write some custom code that runs on that page and does the redirect for you in JavaScript.
Finally, there might be a way to get this to work using the custom 404 page feature in Softr, where if the URL starts with mysite.com/forward and the page does not exist in Softr, the 404 page runs custom code to do the redirect.
So the next question is whether you have a defined list of redirects (and if so, how long it is), or whether you need it to be a rule.
Thanks. It has to be a rule because I need it for mysite.com/forward/<anything>.
I’ve tried all the options you mentioned except for the last one.
This doesn’t work because if I make a page /forward in Softr, it’s only displayed if the user goes to mysite.com/forward and does not work for subpaths like mysite.com/forward/<something> (this goes to a 404 page).
What is the way to set up the 404 page to do custom redirects?