|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
htaccess
I have an .htaccess file in my htdocs directory that i use to point to my own error messages. The problem is that i can only get these error messages to show when i use my ip address:
http://123.123.25.25/some_bogus.html (not actual ip, as i am sure you realised) But when i use my actual domain name. www. it calls the default error messages. I use the following in my htaccess file which works fine as i mentioned above, but only with my ip address in the browser bar. I use this pearl program as it e-mails me about bad pages etc, until i become more experienced. ErrorDocument 401 /cgi-bin/guardian/ag.pl ErrorDocument 403 /cgi-bin/guardian/ag.pl ErrorDocument 404 /cgi-bin/guardian/ag.pl ErrorDocument 500 /cgi-bin/guardian/ag.pl Any ideas of what the problem is would be greatly appreciated. Kind regards Phil (As you guessed a newbie) |
|
#2
|
|||
|
|||
|
It appears that your www.domain.com doesn't resolve to 123.123.25.25 or can't determine its ServerName.
|
|
#3
|
|||
|
|||
|
Sorry but when you say resolve what are you meaning, and is there a way of working around it.
Phil |
|
#4
|
|||
|
|||
|
Zip and attach your httpd.conf here.
|
|
#5
|
|||
|
|||
|
Zip file as requested
Phil |
|
#6
|
|||
|
|||
|
Why you define <Directory "C:/Program Files/Apache Group/Apache/htdocs"> twice?
You don't need to use .htaccess at all. Just put those ErrorDocument lines in httpd.conf anywhere not within any <xxx></xxx> block. |
|
#7
|
|||
|
|||
|
I was not aware that i had placed it in twice, but does it matter? Everything seems to run fine? If it does then i can take it out. I will try as you have suggested.
Thanks Phil |
|
#8
|
|||
|
|||
|
I have done as you suggested, but i am still presented with the same problem. If i use my domain name with a bogus html page, it reverts to the standard 404 error. If i use my ip address with a bogus html page i can get the new 404 error page??
One more thing, does it matter that i have web forwarding? Could this be the problem? Thanks Phil |
|
#9
|
|||
|
|||
|
>> I was not aware that i had placed it in twice
Yes because your Options and AllowOverride for the two are different and .htaccess relies on that. If you place those ErrorDocument lines in httpd.conf then you don't have to worry about AllowOverride at all. >> does it matter that i have web forwarding? Absolutely and no wonder. You need to remove or comment out that ServerName line. Apache will determine all of its available ServerName on startup automatically. Like I said in my very first reply, Apache was unable to determine www.domain.com from its own because your ServerName's domain is for external. |
|
#10
|
|||
|
|||
|
I have commented out the servername as suggested, I now get the following message on starting the server:
"Could not determine the server fully qualified domain name using ip xxx xxx xx xx as servername." I presume you knew that it would say that. SORRY!! But I am still getting the same problem. Phil |
|
#11
|
|||
|
|||
|
>> I presume you knew that it would say that
Yes but that should work though. Or you can even try to set the internal.domain.com as the ServerName. That internal.domain.com should be the FQDN of your box. The one that maps to your 192.168.0.2 or whatever LAN IP. Also, set UseCanonicalName to off, it's almost always off but it's on by default. |
|
#12
|
|||
|
|||
|
I am starting to get a little lost now, excuse my ignorance.
Set the internal.domain.com as the ServerName. ???? That internal.domain.com should be the FQDN of your box. The one that maps to your 192.168.0.2 or whatever LAN IP. ???? I have a page with my service provider that just uses a bit of Java to redirect to my actual server at home, my domain name is forwarded to that page i then redirect to me here at home. Not sure if this is of any help to you at all. I have turned off CanonicalName though. I am very sorry i am appearing to be a little dim, but could you put it in even easier lingo than you probably are??? If you get fed up of trying to assist me, please say i have broad shoulders & won't take it to heart. |
|
#13
|
|||
|
|||
|
Sorry I still don't have a clue of your server + network setup. Do you have a hardware router sitting in front of your Windows box running Apache?
That IP -> 213.171.193.45, was it assigned to your router, another box or your windows box? Does your Windows box (running Apache) have direct internet connection or is it behind a router with 192.168.x.x assigned to it? |
|
#14
|
|||
|
|||
|
Ok, its possibly me not explaining myself correctly.
I have apache running on windows XP- works fine. I have a broadband connection through an external modem provided by my cable supplier. This connection is on 24/7. My IP address provided from my cable supplier is DHCP assigned, i do not switch off so i basically keep the same IP address. Ok so far i hope. The same cable provider gives me web space but none of the other stuff, hence my own server. I use a simple page with a Java redirection script embedded within this page to direct anyone who goes to that page to my own IP address (my server at home). One final routing!! I purchased a domain name with web & e-mail forwarding, they direct the domain name to the free web page space provided by my cable operator. Domain name - to - cable provider page - to - my own server. I hope this helps a little, if it cannot be done, no worries it would have just been nice to have had my own error pages, everything else works a treat. One other thought, would it be better to have my web forwarding going directly to my IP address & missing out the cable providers page. Phil Thanks for trying to assist me. |
|
#15
|
|||
|
|||
|
>> I use a simple page with a Java redirection script
Which exact page? The default index.html page? How about http://www.domain-at-cable-host.com/another-page.html? And what should be done when someone goes to that page? >> they direct the domain name to the free web page So they basically assigned an A record of your domain to point to your cable provider's IP. >> it would have just been nice to have had my own error pages You then have to use external error redirection by specifying the Full URL, not just absolute URI path to ag.pl. >> would it be better to have my web forwarding going directly to my IP address If your IP doesn't change, then of course. Or you should ditch that webhost and sign up for a dynamic DNS hosting service. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > htaccess |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|