Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why do I need to have the / at the end of my URL???

Status
Not open for further replies.

HuggerFanta

Technical User
Apr 22, 2002
87
0
0
SE
Hello again!
Now another problem!

When i type m a url i have to end with "/", why is that???

Have I make this up in the configuration file or dose it have to be this way???

--------------------------------------
Kind regards;
HuggerFanta
 
Hi mate,

When you say URL is this only the actual URL or the directories? Or both?

Also, what is happening when you dont add the slash?

Can you post your httpd.conf so that we can see if there are any syntax problems?

Just change anything such as domain names and ip address'..

Hope this helps Wullie

 
This is the alias config for the folder I whant wounder about:

Alias /musik/ "D:/MyMusic/"

<Directory &quot;D:/MyMusic/&quot;>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory> --------------------------------------
Kind regards;
HuggerFanta
 
Hi mate

I hate to point out the obvious but did you read the httpd.conf file??

# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So &quot;/icons&quot; isn't aliased in this
# example, only &quot;/icons/&quot;.


Try the following..


Alias /musik &quot;D:/MyMusic/&quot;

<Directory &quot;D:/MyMusic&quot;>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Hope this helps Wullie

 
You've probably noticed that most web pages are not retrieved by a specific filename. Instead of typing a URL like this:


you instead usually enter:


This URL maps to a directory named dirname, beneath the directory defined in the server configuration as the DocumentRoot. It is the responsibilty of the module mod_dir to serve a specific page to clients that send a request URL that maps to a directory. Without mod_dir, the second form would be invalid and produce an HTTP 404 error.

Therefore, mod_dir performs two important functions. First, whenever a request is received that maps to a directory but does not have the '/', such as:


mod_dir sends a redirection request to the client indicating that the request should be made to the URL:


This requires a second request from the client, but is generally unnoticed by the user. Omitting the trailing slash is technically an error in the request and you should always include it for the sake of correctness and efficieny.

The second function is to serve a file defined as the index file for the directory specified in the request. index.html is the default for Apache and is set with the DirectoryIndex directive.

If you're getting an error when you omit the '/', the chances are you don't have an index file in the directory you're requesting. ------------------------------------------------------------------
It's important to think. It's what separates us from lentils.
 
Thanx again wullie!
You might know how to get directories protected with .htaccess and htpasswd??

I have read many inputs in this forum about it and even some sites on the net without finding some info for me understandable!!!

Do you know how and are you willy to help me??? --------------------------------------
Kind regards;
HuggerFanta
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top