1

I need to be able to read the request headers coming from a redirect from a naked domain:

http://mydomain.com

to

http://www.mydomain.com/index.html

I need index.html to be able to parse any original request path and queries, how can I do that?

E.g

From naked domain: http://mydomain.com/abc to http://www.mydomain.com/index.html and then index.html will get the abc path request.

The question is how to be able to achieve this?

A similar question: Using DNS to redirect to another URL with a path

Community
  • 1
  • 1
quarks
  • 33,478
  • 73
  • 290
  • 513
  • 1
    How are you doing this redirect? Or is that what you are trying to ask? – gen_Eric Nov 12 '13 at 18:51
  • In simple terms what I need to do is for the DNS host to forward with path, either as real path or just a HTTP header in the request. – quarks Nov 12 '13 at 19:04
  • Why not perform the redirection on the server-side? – Dai Nov 12 '13 at 19:11
  • I'd suggest using your webserver to do this. Apache's `mod_rewrite` is perfect for this job. (P.S. Your "similar question" shows that using DNS for this is *impossible*) – gen_Eric Nov 12 '13 at 19:12

1 Answers1

1

use document properties to check and reditect for others questions use navigator roperties

Get referrer use = document.referrer or document.URL

Look : http://www.w3schools.com/jsref/dom_obj_document.asp

In apache the best solution is control that with .httaccess