Question

I have searched and found solutions that were close, but I have not found anything that is exactly what I'm looking for. I have a two page/step form. I would like all external traffic pointing to page two to be redirected to page one of the form. However, traffic from page one needs to get to page two without being redirected back to page one.

Thanks!

Was it helpful?

Solution

Something like this should work for you:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://example.com [NC]
RewriteRule ^form/page2.php$ http://example..com/form/page1.php [L,R]

Going to http://example.com/form/page2.php will redirect you to http://example.com/form/page1.php unless you are linked to page2.php from within site.com.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top