javascript - Is it possible to create a link from a website that does not work (in the same way) if typed manually in browser? -


i need exclude error it, ask here. have being asked client create page can accessed via link on website cannot accessed (or @ least redirected place) manually copying link or typing browser address bar.

the thing came in mind me using cookie on website , check if user browser has stored cookie when critical page opens. user not coming base website see different or redirect via javascript etc. (i.g. using cookie if {…).

let me know if oversaw possibility or if simply: “there no way that.” thanks!

edit

@marmeladze: sorry not familiar require techniques. cannot take way fear. , not able if works = correct answer.

@mplungjan: wow! didn’t know seemingly simple referrer thing! think way go in accepted answer here: checking referrer cool! sadly, link though direct download link of pdf neither of solutions work because (i wrong maybe?) not able put code in it.

a solution attempt sinatra.

require "sinatra"    '/posts/:slug'   "this post #{params[:slug]}" end  '/*'   "this all-rounder.\n params: #{params[:splat]}" end 

in sinatra, topmost routes have precedence on rest. so, if url sth. yoururl/posts/post-name, caught first route , render text "this post post-name". others caught other route.

$ curl localhost:4567; echo all-rounder.  params: [""] $ curl localhost:4567/posts/on-old-sage; echo post on-old-sage $ curl localhost:4567/posts/information-retrieval; echo post information-retrieval $ curl localhost:4567/posts/unbearable-lightness-of-being; echo post unbearable-lightness-of-being $ curl localhost:4567/make/it/as/deep/as/you/can; echo all-rounder.  params: ["make/it/as/deep/as/you/can"] $ curl localhost:4567/who/is/afraid/of-hegel; echo all-rounder.  params: ["who/is/afraid/of-hegel"] $ curl localhost:4567/all/socrates/knows/is/he-knows-so-little-about-things; echo all-rounder.  params: ["all/socrates/knows/is/he-knows-so-little-about-things"] 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -