如何直接將網址指到預定首頁
例如說
我要把 www.xxddd.com 直接指到 www.xxddd.com/catalog/index.php 不是轉址(redirect)哦 好像是老問題了 還是看看有沒有大大可以回答一下 |
沒辦法~
再怎麼用都還是會觸發301的標頭(網址變更通知) |
如果是同一主機
add domain 路徑就設 home/yourname/catalog/ 就好了 |
請自行搜尋相關用法,任選一種 mod 即可:
mod_alias mod_rewrite |
剛加了 Alias
要如何restart server測試阿? 我大學學的都忘光了 Q_Q |
你把 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: |
恩我是寫在conf/httpd.include裡 應該可以吧??
剛剛查了一下 重啟 apache 可以用service httpd start 指令 但是Alias並沒有成功 M大幫我看看是否寫錯了? Alias / /var/www/vhosts/xxoo.com/httpdocs/catalog/ 還是寫錯檔案了@@ |
剛剛試著放到.htaccess 裡
結果網站整個出錯 "Internal Server Error" 哀 到底 Alias 我是哪裡寫錯啦 Q_Q |
conf/httpd.include ?
你的 apache 是什麼版本?OS?我用過 apache 1.3 apache 2.2 都沒這個檔? 要寫在 conf/httpd.conf。 apache 2.2 若寫在其他檔案,必須在 httpd.conf 設定 Include,如: 代碼:
# Virtual hosts 代碼:
Request exceeded the limit of 10 internal redirects due to probable configuration error. 代碼:
AliasMatch ^/$ /var/www/vhosts/xxoo.com/httpdocs/catalog/index.php |
現在改好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 也是同一頁嗎 |
所有時間均為 +8。現在的時間是 08:43 PM。 |
Powered by vBulletin® 版本 3.8.4
版權所有 ©2000 - 2024,Jelsoft Enterprises Ltd.