0

I have a Perch web site which will be moving (gradually) to a new domain, so I need to redirect some pages to the new URL.

e.g. mysite.com/page1 => mynewsite.com, mysite.com/page2 stays the same

I have tried doing redirects using .htaccess, for example:

Redirect 302 /page1 https://mynewsite.com

This works fine if you type the URL in the browser address bar, but when I click on any link to page1 on the web site, all I get is a white screen and no redirection (I have cleared the browser cache). But then if I refresh the page, it redirects. What am I missing, is there a specific way to redirect Perch pages using .htaccess?

I can't see any way to add a link manually in the admin section (sorry I am not very familiar with Perch) - all I can see is 'Page to link to', with no option to enter an external link. How can you set the link to an external URL?

Thanks.

ardmark
  • 81
  • 1
  • 9
  • 1
    Sounds like perch was using a _client-side_ router? – CBroe Nov 03 '22 at 13:39
  • That makes sense, but would that mean there is no way to do a successful redirect from a link, using .htaccess? – ardmark Nov 03 '22 at 16:35
  • Not if the URL does not get requested from the server to begin with - which is usually how those client-side routers work, they change the address bar content via the History API, and then load some new content in the background using AJAX/fetch. In that case, the "redirect" would have to happen client-side as well. – CBroe Nov 04 '22 at 06:48
  • Thanks, that has clarified this for me. – ardmark Nov 05 '22 at 10:00

0 Answers0