怎么看apache的根目录?我怎么导入的CSS文件找不到?

WBOY
Lepaskan: 2016-06-06 20:08:02
asal
1597 orang telah melayarinya

请问这里面,哪个是服务器的在本机windows的根目录?

<code>Variable    Value
HTTP_HOST    localhost
HTTP_CONNECTION    keep-alive
HTTP_ACCEPT    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT    Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.8.1000 Chrome/30.0.1599.101 Safari/537.36
HTTP_DNT    1
HTTP_REFERER    http://localhost/
HTTP_ACCEPT_ENCODING    gzip,deflate
HTTP_ACCEPT_LANGUAGE    zh-CN
PATH    C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;
SystemRoot    C:\Windows
COMSPEC    C:\Windows\system32\cmd.exe
PATHEXT    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR    C:\Windows
SERVER_SIGNATURE    no value
SERVER_SOFTWARE    Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/5.6.18
SERVER_NAME    localhost
SERVER_ADDR    ::1
SERVER_PORT    80
REMOTE_ADDR    ::1
DOCUMENT_ROOT    C:/AppServ/www
REQUEST_SCHEME    http
CONTEXT_PREFIX    no value
CONTEXT_DOCUMENT_ROOT    C:/AppServ/www
SERVER_ADMIN    admin@example.com
SCRIPT_FILENAME    C:/AppServ/www/info.php
REMOTE_PORT    49557
GATEWAY_INTERFACE    CGI/1.1
SERVER_PROTOCOL    HTTP/1.1
REQUEST_METHOD    GET
QUERY_STRING    no value
REQUEST_URI    /info.php
SCRIPT_NAME    /info.php</code>
Salin selepas log masuk
Salin selepas log masuk
<code>为什么我在www文件下定义了一个css文件,用:<link rel="stylesheet" type="text css" href="/css.css">
不行!</code>
Salin selepas log masuk
Salin selepas log masuk
<code>而用:<link rel="stylesheet" type="text css" href="/www/css.css">
就行了???</code>
Salin selepas log masuk
Salin selepas log masuk

根目录不是 C:/AppServ/www 吗?

回复内容:

请问这里面,哪个是服务器的在本机windows的根目录?

<code>Variable    Value
HTTP_HOST    localhost
HTTP_CONNECTION    keep-alive
HTTP_ACCEPT    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT    Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.8.1000 Chrome/30.0.1599.101 Safari/537.36
HTTP_DNT    1
HTTP_REFERER    http://localhost/
HTTP_ACCEPT_ENCODING    gzip,deflate
HTTP_ACCEPT_LANGUAGE    zh-CN
PATH    C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;
SystemRoot    C:\Windows
COMSPEC    C:\Windows\system32\cmd.exe
PATHEXT    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR    C:\Windows
SERVER_SIGNATURE    no value
SERVER_SOFTWARE    Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/5.6.18
SERVER_NAME    localhost
SERVER_ADDR    ::1
SERVER_PORT    80
REMOTE_ADDR    ::1
DOCUMENT_ROOT    C:/AppServ/www
REQUEST_SCHEME    http
CONTEXT_PREFIX    no value
CONTEXT_DOCUMENT_ROOT    C:/AppServ/www
SERVER_ADMIN    admin@example.com
SCRIPT_FILENAME    C:/AppServ/www/info.php
REMOTE_PORT    49557
GATEWAY_INTERFACE    CGI/1.1
SERVER_PROTOCOL    HTTP/1.1
REQUEST_METHOD    GET
QUERY_STRING    no value
REQUEST_URI    /info.php
SCRIPT_NAME    /info.php</code>
Salin selepas log masuk
Salin selepas log masuk
<code>为什么我在www文件下定义了一个css文件,用:<link rel="stylesheet" type="text css" href="/css.css">
不行!</code>
Salin selepas log masuk
Salin selepas log masuk
<code>而用:<link rel="stylesheet" type="text css" href="/www/css.css">
就行了???</code>
Salin selepas log masuk
Salin selepas log masuk

根目录不是 C:/AppServ/www 吗?

看 DOCUMENT_ROOT

apachehttpd.conf文件 搜索DocumentRoot查看apache指定的根目录

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan