Given a homepage at domain.com (e.g., domain.com/index.htmlhttps://example.com/
), I want:
- outside requests to only be able to visit the homepage and no subpages
- that homepage to successfully redirect visitors to a subpage (for example, domain.com/page1.html
https://example.com/page1.html
)
I can accomplish #2 with some simple JavaScript and window.location.href = domainexample.com/page1.html
. But for #1, is there a way to reject access to internal pages if the referrer is coming from my domain.com? Basically the flow I'm looking for is:
- outside visitor visits domain.com/index.html
https://example.com/
- domain.com/index.html
https://example.com/
redirects visitor to, for example, domain.com/page1.htmlexample.com/page1.html
- any attempt to visit domain.com/page1.html
example.com/page1.html
directly fails with a 404
I get that this may all seem nonsensical in terms of what it does. That's by design. I want a website that sends visitors to internal pages, but only if they get there through the homepage redirecting them to it.