Results 1 to 7 of 7

Thread: URLS and Redirecting

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    URLS and Redirecting

    All,

    I have a url xyz.com where there is a form to be submitted to xyz.com/test.aspx

    Everything works great!

    However we also had to create another url subdomain.xyz.com that also points to that page xyz.com.

    Upon form submit, we get a page not found because the code is looking for xyz.com and not subdomain.xyz.com.

    How do we fix?

    Thanks

  2. #2
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: URLS and Redirecting

    You must submit to the absolute URL i.e. http://subdomain.xyz.com/test.aspx as browsers treat subdomains as completely unrelated websites.

    I think that's what you were getting at - let me know if I've misunderstood.

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Re: URLS and Redirecting

    Quote Originally Posted by dj4uk
    You must submit to the absolute URL i.e. http://subdomain.xyz.com/test.aspx as browsers treat subdomains as completely unrelated websites.

    I think that's what you were getting at - let me know if I've misunderstood.

    DJ
    What you are suggesting is the very thing that gives us the error because there is no pges on that subdomain. It is just a DNS entry pointing to xyz.com.

  4. #4
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: URLS and Redirecting

    Ah right gotcha!

    Why the need for the subdomain if you don't mind me asking?

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Re: URLS and Redirecting

    Quote Originally Posted by dj4uk
    Ah right gotcha!

    Why the need for the subdomain if you don't mind me asking?

    DJ

    client request

  6. #6
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: URLS and Redirecting

    I use the RewritePath method in the Application_BeginRequest method of a global.asax file to do URL rewriting e.g. form posted to /home.aspx actually is executed by the page /html/home.aspx - still shows /home.aspx in address bar. But I've never tried this on different subdomains.

    You could try adding this global.asax file to the root of subdomain.xyz.com.
    Code:
    void Application_BeginRequest(Object sender , EventArgs e)
    {
            Context.RewritePath( "http://www.xyz.com" + Request.Path );
    }
    I have a feeling this only works on the same subdomain I'm afraid.

    The other option is looking into installing a ISAPI filter on the subdomain such as OpUrl - this intercepts the request at an earlier point and should work. You can download a 14 day trial to test.

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Re: URLS and Redirecting

    thanks for the suggestion but what we did was simply hardcode the thank you page url in the form submit. It works for now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width