1 頁 (共 1 頁)

[問題] 網址有加"/"及沒加"/"的狀況

發表於 : 2005-03-16 00:20
ahdaa
安裝上去後又發現有一個問題咧\r
譬如說,在網址咧輸入\r
http://phpbb-tw.net/phpbb/ ←有加"/"
可以正確進入網址

若是沒有加上"/"
如:http://phpbb-tw.net/phpbb  ←沒有加"/"
我的會造成網頁找不到的問題
而貓空這會自動轉成http://www.phpbb-tw.net/phpbb/

不知道這是什麼樣子的問題
請各位大大指點一下

發表於 : 2005-03-16 08:27
deliabest
apache ===>add index.php

發表於 : 2005-03-16 10:38
ahdaa
deliabest 寫:apache ===>add index.php
小弟的web系統是架在linux之下
是指說在html的子目錄下加入index.php當首頁嗎??

發表於 : 2005-03-16 11:27
bebe2803
嗯.... 是真的 @@

因為現在人們上網也是按(已打好, 沒問題的)連結, 很少再自己打 url... 除非在 alias (當然是 httpd.conf 內) 那裡另加一個沒有 / 的...

發表於 : 2005-03-16 13:51
ahdaa
哇~沒有用呀:-o
加上了這些咚咚
它還是自己跳到127.0.0.1
不然就是說127.0.0.1連線逾時呀

Alias /phpbb2 "/var/www/html/phpbb2/"
<Directory "/var/www/html/phpbb2/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

發表於 : 2005-03-16 13:55
bebe2803
你要有系統控制台的管理選項, 改網域名稱才不會跳回 127.0.0.1 或 localhost @@

發表於 : 2005-03-16 14:50
ahdaa
bebe2803 寫:你要有系統控制台的管理選項, 改網域名稱才不會跳回 127.0.0.1 或 localhost @@
快要瘋了
網域名稱我也改過了
有"/"沒"/"

網域名稱/phpbb2或
網域名稱/phpbb2/

ip/phpbb2或
ip/phpbb2/

都試了
就是死都沒有用\r

系統程式的存放我也是\r
都試了上面的那些

發表於 : 2005-03-16 18:53
進藤光
不說你的架站環境,天曉得問題在哪?

發表於 : 2005-03-16 22:22
ahdaa
進藤光 寫:不說你的架站環境,天曉得問題在哪?
謝謝您的提醒
可是小弟是不覺得因為架站環境的影響而造成這種狀況
所以才都沒有提

小弟的架站環境
Mandrake 10.1
apache是用urpmi到mirro station找來的apache2-2.0.50
它的預設目錄不像平常一樣的放在/etc/apache底下
所以,小弟也不知道它將httpd擺在哪兒
到是/etc/httpd/conf/底下亦有個httpd.conf檔
修改內容後,restart httpd
還是沒有任何改變哩

[問題] 我也有相同問題

發表於 : 2005-03-20 20:18
Szuzy
http://moonyisland.com/childs/invoive 找不到\r
http://moonyisland.com/childs/invoive/ 可找到\r

IIS 無此問題,只有 Appserv 會,
我是很多網址掛在不同目錄下,如...
D:\AppServ\www\szuzy\index.php
D:\AppServ\www\childs\index.php
D:\AppServ\www\chipwalker\index.php
D:\AppServ\www\childs\invoice\index.php
...

幾年前在入口網站登錄時,有的忘記加入 '/',如...
http://moonyisland.com/childs/invoice
改成 AppServ 後,經過一段時間才發現這個問題,
結果訪客都快跑光了,還無解!
所以暫時換回 IIS!

發表於 : 2005-03-21 17:41
ethan
先確定 DirectoryIndex 裡面有加入 index.php
大部份來說導向應該都會正常,或是參考 Apache FAQ

http://httpd.apache.org/docs/misc/FAQ.html
Why does accessing directories only work when I include the trailing "/" (e.g., http://foo.domain.com/~user/) but not when I omit it (e.g., http://foo.domain.com/~user)?

When you access a directory without a trailing "/", Apache needs to send what is called a redirect to the client to tell it to add the trailing slash. If it did not do so, relative URLs would not work properly. When it sends the redirect, it needs to know the name of the server so that it can include it in the redirect. There are two ways for Apache to find this out; either it can guess, or you can tell it. If your DNS is configured correctly, it can normally guess without any problems. If it is not, however, then you need to tell it.

Add a ServerName directive to the config file to tell it what the domain name of the server is.

The other thing that can occasionally cause this symptom is a misunderstanding of the Alias directive, resulting in an alias working with a trailing slash, and not without one. The Alias directive is very literal, and aliases what you tell it to. Consider the following example:

Alias /example/ /home/www/example/
The above directive creates an alias for URLs starting with /example/, but does not alias URLs starting with /example. That is to say, a URL such as http://servername.com/example/ will get the desired content, but a URL such as http://servername.com/example will result in a "file not found" error.

The following Alias, on the other hand, will work for both cases:

Alias /example /home/www/example