查看完整版本 : 如何直接將網址指到預定首頁
18SUPER
2011-07-12, 01:11 PM
例如說
我要把
www.xxddd.com
直接指到
www.xxddd.com/catalog/index.php
不是轉址(redirect)哦
好像是老問題了
還是看看有沒有大大可以回答一下
piece2ec
2011-07-12, 01:36 PM
沒辦法~
再怎麼用都還是會觸發301的標頭(網址變更通知)
sakillll
2011-07-12, 02:27 PM
如果是同一主機
add domain 路徑就設 home/yourname/catalog/
就好了
mushroom
2011-07-13, 12:53 AM
請自行搜尋相關用法,任選一種 mod 即可:
mod_alias
mod_rewrite
18SUPER
2011-07-13, 11:28 AM
剛加了 Alias
要如何restart server測試阿? 我大學學的都忘光了 Q_Q
mushroom
2011-07-13, 01:44 PM
你把 Alias 寫在哪裡?
寫在 .htaccess 不用重啟,請重新下載網頁。
若是沒作用,請檢查 http.conf 取消設定 AllowOverride None
若是寫在 http.conf,要重啟 apache,
BSD 這樣重啟:
/usr/local/etc/rc.d/apa[按 Tab] restart
Linux 方法應該差不多,請自行搜尋。
假如你的權限夠的話,寫在 http.conf 效能會比 .htaccess 好。
若是用 IIS... 我不會使用 IIS ~greenlau: 我只會開阿帕契 ~embarass:
18SUPER
2011-07-14, 03:24 PM
恩我是寫在conf/httpd.include裡 應該可以吧??
剛剛查了一下
重啟 apache 可以用service httpd start 指令
但是Alias並沒有成功
M大幫我看看是否寫錯了?
Alias / /var/www/vhosts/xxoo.com/httpdocs/catalog/
還是寫錯檔案了@@
18SUPER
2011-07-14, 03:30 PM
剛剛試著放到.htaccess 裡
結果網站整個出錯 "Internal Server Error"
哀 到底 Alias 我是哪裡寫錯啦 Q_Q
mushroom
2011-07-14, 08:20 PM
conf/httpd.include ?
你的 apache 是什麼版本?OS?我用過 apache 1.3 apache 2.2 都沒這個檔?
要寫在 conf/httpd.conf。 apache 2.2 若寫在其他檔案,必須在 httpd.conf 設定 Include,如:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
出現 Internal Server Error,那 error.log 記錄什麼?假如是這種錯誤:
Request exceeded the limit of 10 internal redirects due to probable configuration error.
那你把語法改成這個試試看:
AliasMatch ^/$ /var/www/vhosts/xxoo.com/httpdocs/catalog/index.php
這邊有說明: http://httpd.apache.org/docs/2.2/mod/mod_alias.html
18SUPER
2011-08-09, 02:09 PM
現在改好ok了!
但是因為之前seo的連接都來還是
www.xxddd.com/catalog/index.php
不是
www.xxddd.com/index.php
現在www.xxddd.com/catalog/index.php就跟我說找不到網頁 囧
有辦法保留原先的
www.xxddd.com/catalog/index.php
同時
www.xxddd.com/index.php
也是同一頁嗎
vBulletin® v3.8.4,版權所有 ©2000-2026,Jelsoft Enterprises Ltd.