Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My server is "www.myserver.com" and the default homepage is located in
/var/www/index.html.
If the client go to "www.myserver.com/abc", it shows no homepage found.
I want to set that the URL: www.myserver.com/?????/????? go to the
default homepage.
You question is answered very nicely within the apache documentation or even reading through the httpd.conf file
read http://httpd.apache.org/docs/mod/cor...#errordocument
its half a page
but in short modify the
ErrorDocument 404 /cgi-bin/bad_urls.pl
to something like
ErrorDocument 404 /index.html or whatever your main file is called.
Firstly, thanks for your reply. You're really a nice guy.
>but in short modify the
>ErrorDocument 404 /cgi-bin/bad_urls.pl
>to something like
>ErrorDocument 404 /index.html or whatever your main file is called. [/B][/QUOTE]
I really add a line "ErrorDocument 404 /index.html" in the httpd.conf and restart the apache (even reboot the machine later).
I still found that "www.myserver.com" go to the the default homepage /var/www/index.html
and "www.myserver.com" go to nothing.
Is there anything wrong? I am using the Debian 3.0 with kernel 2.4.
What can I do now?
Originally posted by swmok
I still found that "www.myserver.com" go to the the default homepage /var/www/index.html
and "www.myserver.com" go to nothing.
I guess im not understanding what you are trying to say. Both urls are exactly the same "www.myserver.com"
The DocumentRoot setting is the one that will set the default directory for the server. This can be done globally, or within a block defining a VirtualHost. You may also define Directory blocks.
The comments in httpd.conf are usually good enough to get you started.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.