歡迎光臨, 訪客. 請先 登入註冊一個帳號.
三月 29, 2024, 12:38:51 上午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  支援  |  安裝與設定  |  關於簡短網址的一些困難 « 上篇主題 下篇主題 »
頁: [1]
作者 主題: 關於簡短網址的一些困難  (閱讀 9785 次)
orangejay
新手見習
*
文章: 17


檢視個人資料
« 於: 七月 22, 2005, 03:43:13 下午 »

我前幾天開始設置簡潔網址但是一直都沒成功。
我把.htaccess檔, 改為
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php

然後也選擇了「讓搜尋引擎易於搜尋的簡潔網址」
文章鏈接也變成了
http://localhost/post/1/1
但是顯示為404錯誤(找不到檔案)
其他頁面也顯示不出來,是還需要設置其他的文件嗎?
已記錄
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #1 於: 七月 22, 2005, 03:50:24 下午 »

引用自: orangejay
我前幾天開始設置簡潔網址但是一直都沒成功。
我把.htaccess檔, 改為
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php

然後也選擇了「讓搜尋引擎易於搜尋的簡潔網址」
文章鏈接也變成了
http://localhost/post/1/1
但是顯示為404錯誤(找不到檔案)
其他頁面也顯示不出來,是還需要設置其他的文件嗎?


我『假設』你是用 Apache,我也假設,這個站台的 http.conf 你可以修改,那麼你可以把

跟目錄修改如下,讓他可以透過 .htaccess 來 override
程式碼:
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>


假設,你不希望正個站台都可以 override,你可以新增加下面的敘述,來讓只有pLog 這個目錄可以被 .htaccess 的設定來 override。

程式碼:
<Directory "D:/Apache2/htdocs/pLog">
Options Multiviews
AllowOverride All
Order allow,deny
Allow from all
</Directory>


Mark
已記錄

orangejay
新手見習
*
文章: 17


檢視個人資料
« 回覆文章 #2 於: 七月 22, 2005, 04:47:13 下午 »

感謝MARK,你說的兩种方法我都試過了,但還是同樣的報錯,在一般模式下都正常的
已記錄
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #3 於: 七月 22, 2005, 04:50:23 下午 »

引用自: orangejay
感謝MARK,你說的兩种方法我都試過了,但還是同樣的報錯,在一般模式下都正常的


改完後要重開 apache 才行。

Mark
已記錄

SmilingOx
新手見習
*
文章: 15


檢視個人資料 個人網站
« 回覆文章 #4 於: 七月 23, 2005, 01:30:28 下午 »

估计你的Apache 是2.0以上的版本
<Directory />
    Options FollowSymLinks
    AllowOverride None</Directory> 修改为:All

-------------------------------------
<Directory "你的WEB目录">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride None  改为:All

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>
------------------------

#<Files ~ "^\.ht">
#   Order allow,deny
#    Deny from all
#</Files>

这样处理后,估计可以了
已記錄
頁: [1]
LifeType 中文開發論壇  |  支援  |  安裝與設定  |  關於簡短網址的一些困難 « 上篇主題 下篇主題 »
    前往: