Hi All, I have been investigating about a problem and I have no idea how to solve it. I would like to define a rule in the .htaccess file to solve the following situation: If the user enters the following url: mypage I would like the system redirects to the following one: folder1/mypage/ and in the case that 'folder1/mypage' does not exist, redirects to the following one: folder1/folder2/mypage/ is that possible? Thank you.
I don't know how to do it modifying the data in .htaccess, but I will show you a way to do it in html. <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>LIFE COVER SURVEY</title> <meta http-equiv="refresh" content="0;url=yourpageXXXXXXXXXXXXX"> </head> <body> <p> Redirecting to latest newsletter. If you're not redirected within a couple of seconds, click here:<br /> <a href="yourpageXXXXXXXXXXXXX">CLICK HERE IF YOU ARE NOT REDIRECTED IN 5 SECONDS</a> </p> </body> Replace "yourpageXXXXXXXXXXXX" with your "folder1/mypage". Now, if this page does not exist, the server will redirect the visitor to "not_found.html" (or something similar). So, you have 2 options, depending on your needs: 1. put all the information from "folder1/folder2/mypage" on "not_found.html" or, 2. create a new redirect from this page to "folder1/folder2/mypage". The only problem with this is that every time somebody goes to a page that does not exist on your website , they will get to "folder1/folder2/mypage". Sorry, I'm not an expert in html , but I hope this helps.
Hi PK-Host. My solution has nothing to do with with my original question I used another approach to avoid this situation.