LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-28-2004, 03:27 PM   #1
boondock_saint
LQ Newbie
 
Registered: Jun 2004
Posts: 7

Rep: Reputation: 0
Apache trailing slash


here is my problem

if i go to myserver.com/directory/
it works
if I try myserver.com/directory
it gives me a connection refused error.

I've read through some posts and read that aliases would fix it but I don't want to create an alias for every directory on here. Someone else mentioned the Options Directive but I'm unclear as to how that should be set up to automatically attach the slash at the end?
Any help would be greatly appreciated.

Thanks,
The Boondock Saint
 
Old 06-28-2004, 06:01 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 57
Welcome to LinuxQuestions!

The simplest way of solving this is by specifying "UseCanonicalName On" in your Apache config file. This will automatically attach the slash and Apache will be happy. Works for both Apache 1.4 and 2.0, and you can specify it in any global section of the config file (not in the <Directory> parts, etc).


Håkan

Last edited by hw-tph; 06-28-2004 at 06:03 PM.
 
Old 06-28-2004, 10:10 PM   #3
boondock_saint
LQ Newbie
 
Registered: Jun 2004
Posts: 7

Original Poster
Rep: Reputation: 0
"UseCanonicalName On" is already in the conf file. Any other suggestions?
 
Old 06-29-2004, 02:30 PM   #4
boondock_saint
LQ Newbie
 
Registered: Jun 2004
Posts: 7

Original Poster
Rep: Reputation: 0
argh .... don't tell that no one here has a clue as to how to fix it ????
 
Old 06-29-2004, 04:28 PM   #5
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
i left my apache settings as default and dont have that problem so sadly i cant help much.
 
Old 06-29-2004, 10:31 PM   #6
boondock_saint
LQ Newbie
 
Registered: Jun 2004
Posts: 7

Original Poster
Rep: Reputation: 0
so did I
 
Old 06-30-2004, 12:35 AM   #7
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 57
First off make sure that you're editing the correct file. If you have one instance of Apache2 installed with the distribution and one installed from source you're likely to be editing the wrong file (and believe me, we've had those problems here ).


Håkan
 
Old 06-30-2004, 10:24 AM   #8
boondock_saint
LQ Newbie
 
Registered: Jun 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Well I have httpd.conf and httpd2.conf the global settings you mentioned are in commonhttpd.conf

I'm not using virtual hosts and all settings are the default settings. Is there another way I could do this like having a .htaccess file in the server root that takes the request for "directory" and forwards it to "directory/"

This is driving me mad.
 
Old 06-30-2004, 02:46 PM   #9
boondock_saint
LQ Newbie
 
Registered: Jun 2004
Posts: 7

Original Poster
Rep: Reputation: 0
ok I just noticed that if you type dogicdesign.com//myspace
(two slashes) then it auto attaches the slash at the end and loads fine.

any clues ???
 
Old 07-07-2004, 03:31 PM   #10
pdebian
LQ Newbie
 
Registered: Jul 2004
Posts: 1

Rep: Reputation: 0
Re: Apache trailing slash

Got it! At least, for VirtualHost's.

First, your ServerName should be set in your global httpd.conf. As in:

Code:
ServerName   www.example.com
Second, each VirtualHost must have a ServerName specified. For example, here's my settings:

Code:
<VirtualHost 123.456.789.100>
    ServerAdmin jennifer @ example.com
    DocumentRoot /var/www/example
    ServerAlias example.com www.example.com
    ServerName example.com
</VirtualHost>
YMMV...

Last edited by pdebian; 07-07-2004 at 03:36 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trailing slash problem in apache... or DNS? Swakoo Linux - Newbie 1 06-07-2005 10:20 PM
no trailing slash -> apache redirect to microsoft site? SerfurJ Linux - Software 6 03-15-2005 06:25 AM
trailing slash in Apache gives 404 errors rabbate Linux - General 6 04-30-2004 08:34 AM
Apache trailing slash puzzler tantric Linux - Software 4 04-11-2004 04:18 PM
Necessary trailing slash in apache directories silversky Linux - Software 3 03-03-2004 03:19 AM


All times are GMT -5. The time now is 02:38 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration