LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-26-2002, 12:43 PM   #1
Cynthia Blue
Member
 
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102

Rep: Reputation: 15
Backslash in URL


Just a little question...

Setting up some directories on my server. When I go to:
http://www.cynthiablue.net/fur/forums/
I can reach the page. However, typing in:
http://www.cynthiablue.net/fur/forums
gives me a not available error. How come that last backslash is mandatory, and is there a setting I can change that will allow the URL without a backslash?

Thanks.
 
Old 12-26-2002, 02:12 PM   #2
speedracer05
Member
 
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33

Rep: Reputation: 15
Hello Cynthia Blue,

Are you running Apache? If so, you can alter the ServerName of your httpd.conf file to allow for the URL to work without the trailing slash... please refer to a previous post:

http://www.linuxquestions.org/questi...threadid=27052

Happy Holidays
 
Old 12-26-2002, 02:33 PM   #3
Cynthia Blue
Member
 
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102

Original Poster
Rep: Reputation: 15
Ah excellent thank you! I did a search, but didn't know what to search for.

Errrr and yes I'm running Apache.
 
Old 12-26-2002, 08:51 PM   #4
Cynthia Blue
Member
 
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102

Original Poster
Rep: Reputation: 15
Okay I went to my conf file and tried it... I'm still not able to browse to the directory without a slash. Forgive me, I'm very new to Linux.

My Servername was set to mydomain.com... I changed it to www.mydomain.com, and no change. The Apache page says:

Quote:
If you are using name-based virtual hosts, the ServerName inside a <VirtualHost> section specifies what hostname must appear in the request's Host: header to match this virtual host.
I have my main domain name (only one I currently have on there atm), set as the Default Virtual Host. I added a second URL just for fun (it's not real, I figured it can't hurt) in the virutal host section. On my primary URL virtual host section the ServerName is _default_:80. When I try to change this to www.cynthiablue.net, I am unable to restart httpd... the error I get is:
httpd failed. The error was: Stopping httpd: [ok]. Starting httpd (99)Cannot assign requested address: make_sock: could not bind to address 198.IP:80 no listenign sockets aailable, shutting down [failed].

I'm lost.
 
Old 12-28-2002, 02:49 AM   #5
speedracer05
Member
 
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33

Rep: Reputation: 15
If you are using www.mydomain.com literally, and "hostname" does not reflect www.domain.com, then it will not work. Apache is not going to recognize www.mydomain.com on your server and resolve properly.

Try using your IP number for the ServerName. Use ifconfig to find the IP number for your server.

Just out of curiosity, I see your domain is hosted through Verio, did you have Verio direct your domain to your server?

Thanks.

Last edited by speedracer05; 12-28-2002 at 02:57 AM.
 
Old 12-28-2002, 10:56 AM   #6
Cynthia Blue
Member
 
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102

Original Poster
Rep: Reputation: 15
My domain name registrar is namesdirect, and my dns manager is verisigndns. I have verisigndns pointing to my static IP provided by my ISP.

I tried the external IP address, and the internal IP address in Server Name.. still not working.

I still can reach my server by typing in my domain name. That seems to work fine reardless of what my ServerName is set to. Hrm.
 
Old 12-28-2002, 02:28 PM   #7
speedracer05
Member
 
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33

Rep: Reputation: 15
If you shutdown Apache, then try to access your site, are you still able to view your site? It may take a little while for the DNS to be updated before you can actually see your changes.

Can you access your site locally? I mean using http://localhost/fur/forums/? If so, try updating httpd.conf, then restarting, and checking your changes locally.

Thanks.
 
Old 12-29-2002, 01:28 PM   #8
Cynthia Blue
Member
 
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102

Original Poster
Rep: Reputation: 15
Hmm.. not sure we are understanding each other. I can access my site fine, and I haven't made any changes to my dns manager. Changing the ServerName doesn't seem to be changing whether I can access my site or not. The only problem I'm having, is getting apache to differentiate between a file and a directory. If there is no slash, it thinks it's a file, and I get page not found. If there is a slash, it goes to the right page in the directory.

Maybe I'm not understanding what you mean... Each time I make a change, I've shut down and restarted apache.

Thanks.
 
Old 12-30-2002, 06:06 PM   #9
speedracer05
Member
 
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33

Rep: Reputation: 15
Sorry for the delay... been doing the holiday travel thing

Please try the following:

/etc/rc.d/init.d/httpd stop

Now try accessing your site:

http://www.cynthiablue.net

Are you able to see your site?

If so, the changes that you make to Apache will not take affect immediately. Otherwise, if you make changes to your ServerName, you will need to wait a little while before your changes take affect.
 
Old 12-30-2002, 07:11 PM   #10
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Rep: Reputation: 30
Actually that's a forward slash.
 
Old 12-30-2002, 09:55 PM   #11
DeezNutz
LQ Newbie
 
Registered: Dec 2002
Location: Ocean County, NJ
Distribution: Mandrake 9.0
Posts: 22

Rep: Reputation: 15
I'm having sort of a similar problem. (It mat or may not be related to Cynthia's problem, but I'll throw it out there anyway.)

I put a few pictures in a directory under the html root. When I access it from behind my router, everything is peachy. If I try to access the folder from outside it only works with the trailing "/". It looks like when the "/" is left off, apache tries to send it to the local ip addy (192.168.1.X) instead of the ISP assigned IP or even the name. (I set up an account with No-IP, so I can access my systems without having to try to find the IP address when I'm not at home.

Hopefully this will shed some light on the problem.
 
Old 12-30-2002, 10:15 PM   #12
Cynthia Blue
Member
 
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102

Original Poster
Rep: Reputation: 15
Per my original post it's not the main domain name that is the problem. It's the subdirectories/filenames.

This:
http://www.cynthiablue.net/fur/
works okay (yeah slash, I always get them confused )

But this:
http://www.cynthiablue.net/fur
Does not (if you click on the links, you will see what I mean.

So, it seems apache thinks that the url with no slash is a file, and cannot find that file, because I don't have a file of that name. It's a directory.

Oh, and yes, if I stop apache, then I cannot see my site. It's pretty instantaneous.

Last edited by Cynthia Blue; 12-30-2002 at 10:18 PM.
 
Old 12-31-2002, 03:01 PM   #13
speedracer05
Member
 
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33

Rep: Reputation: 15
Okay, I just wanted to make sure that your changes were instantaneous.

If you are behind your router, refering to DeezNutz post, you could use your local IP for the ServerName and the trailing slash problem should be rectified.

Another option would be to use a rewrite rule:

http://httpd.apache.org/docs/misc/rewriteguide.html

Look under "Trailing Slash Problem".
 
Old 12-31-2002, 03:13 PM   #14
Cynthia Blue
Member
 
Registered: Dec 2002
Location: SLC Utah USA
Distribution: SuSe 9.1
Posts: 102

Original Poster
Rep: Reputation: 15
My DSL Modem acts as a router...

I'll read over that info, too, thanks.
 
Old 01-02-2003, 04:08 PM   #15
speedracer05
Member
 
Registered: Jul 2002
Location: San Diego
Distribution: RH 8
Posts: 33

Rep: Reputation: 15
I should have included this in my previous post...

Here is what your httpd.conf should look like with an example rewrite rule for your "fur" directory (assuming that your root directory is /var/www/html):

# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">

#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes Includes FollowSymLinks

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
#
# HERE IS OUR REWRITE INFORMATION
#
RewriteEngine on
RewriteBase /
RewriteRule ^fur$ fur/ [R]
</Directory>

I hope this helps.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR The requested URL could not be retrieved While trying to retrieve the URL: /re Niceman2005 Linux - General 1 06-29-2005 10:51 AM
Help Deleting a Backslash! Am i an idiot? farmerjoe Programming 3 03-21-2005 12:03 PM
backslash input in script esasse Linux - Newbie 6 02-17-2005 07:55 AM
Trailing Backslash problem duerra Linux - Newbie 6 01-28-2004 01:58 PM
Apache: Need backslash to indicate directory? kipbenson4 Linux - Software 2 08-12-2003 10:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:32 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration