Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2003
    Location
    Denmark
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    probs w .htaccess errordocument

    I've created a .htaccess like this (on an Apache/1.3.27 Server):

    # -FrontPage-

    DirectoryIndex index.asp default.asp
    ErrorDocument 403 /error/403.asp
    ErrorDocument 404 /error/404.asp

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    It works fine with the errordocs, even from subdirs. However, I found a problem that I cannot solve, even after looking through this forum and gigabytes of reference manuals...
    When I try to access a directory like 'www.mydomain.com/mydir' it works fine but when I use 'mydir.mydomain.com' I get a server error Not Found or Forbidden depending if mydir exists or not and then 'Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.'

    After testing a lot of configurations I have narrowed the problem down to this (I think): If I use mydir.mydomain.com, it will look for the errorpage at mydir/error/404.asp.

    One solution would be to use absolute paths, ie. http://www.mydomain.com/error/404.asp but I don't like that option since it would replace the address in the browser's address bar.

    Any suggestions how to fix this or maybe how to make a check to see if there is a directory name at the beginning of the entered URL?

    Thanks in advance

  • #2
    New Coder
    Join Date
    Nov 2003
    Location
    Denmark
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Additional question

    The 'mydir' part of the 'mydir.mydomain.com' which translates to 'www.mydomain.com/mydir', is that what is meant by a virtual directory? Or is it called something else?

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    the server sees the blah.thepage.com and thepage.com as two totally different sites. You are going to have to hard code them in to the best of my knowledge.
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #4
    New Coder
    Join Date
    Nov 2003
    Location
    Denmark
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, that was what I was afraid of. Using absolute paths works fine, as I mentioned, but I was hoping somehow to be able to make it look for the error pages in the root without the dir name...


  •  

    Posting Permissions

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