Redirect rule for WKND SPA landing page | Community
Skip to main content
Level 2
August 17, 2022
Solved

Redirect rule for WKND SPA landing page

  • August 17, 2022
  • 1 reply
  • 631 views
Hi, I'm trying to write a redirect rule for SPA site which has a structure similar to the WKND SPA site. (/content/wknd-spa-react/us/en/home) When I hit the domain (http://wkndspa.local:8080), I need the PT rewrite rule to redirect to /content/wknd-spa-react/us/en/home. I've used the below rule. RewriteRule ^/?$ /content/wknd-spa-react/us/en/home.html [PT,L] But it's not working as http://wkndspa.local:8080/.model.json is triggered and throwing some console errors. How can I redirect the domain to a home landing page?
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kaikubad

Add the following rewrite rule to redirect requests from the root domain to the desired landing page:

 

RewriteEngine On RewriteRule ^$ /content/wknd-spa-react/us/en/home [L,R=301]

The RewriteRule directive matches requests with an empty path (root domain) and redirects them to /content/wknd-spa-react/us/en/home. The R=301 flag indicates a permanent redirect, which is recommended to preserve SEO rankings and indicate to search engines that the redirection is permanent.

then restart apache service.

1 reply

kaikubad
Community Advisor
kaikubadCommunity AdvisorAccepted solution
Community Advisor
July 31, 2023

Add the following rewrite rule to redirect requests from the root domain to the desired landing page:

 

RewriteEngine On RewriteRule ^$ /content/wknd-spa-react/us/en/home [L,R=301]

The RewriteRule directive matches requests with an empty path (root domain) and redirects them to /content/wknd-spa-react/us/en/home. The R=301 flag indicates a permanent redirect, which is recommended to preserve SEO rankings and indicate to search engines that the redirection is permanent.

then restart apache service.