apache2 mod_rewrite - Linux

Tristan Cohan avatar
By Tristan Cohan
at 2009-07-07T21:45

Table of Contents

就是小弟有個網域 *.aaa.net

然後我希望每個使用者有兩種網址可以到達自己的目錄

例如: user.aaa.net 或是 www.aaa.net/~user

於是我寫了幾個rule

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName *.aaa.net
DocumentRoot /var/www/

RewriteEngine on
RewriteCond "%{HTTP_HOST}" "^(user_reg_exp)\.aaa\.net$" [NC]
RewriteRule "(.*)" "/nfs/%1" [L]

...
</VirtualHost>

但這樣就發現

當要使用www.aaa.net/~user的時候

apache會把www拿來parse

結果就變成導到/nfs/www了

請問要怎麼解決這個@@

謝謝!!

--
Tags: Linux

All Comments

yum update不了

Madame avatar
By Madame
at 2009-07-07T16:46
裝了fedora...可是package都不能用yum 沒有repos.d folder why? [rootatLinux25 etc]# yum update Gathering header information file(s) from server(s) Server: Fedora Core ...

good site

Andrew avatar
By Andrew
at 2009-07-07T15:56
http://fanqiang.chinaunix.net/index_b.shtml http://fanqiang.chinaunix.net/a4/b7/ - ...

cygwin 的使用

Andrew avatar
By Andrew
at 2009-07-07T14:35
之前因為上課的需要 所以有安裝cygwin 再去跑一些程式 在dos下打 sh 就可以執行.sh的檔案了 但是現在重新裝過之後就沒有辦法執行 因為之前是用老師的設定好的版本 所以現在也不知道怎麼解決...... 不知道有哪位高人可以說一下是哪裡出了問題嗎 - ...

Linux的指令

Callum avatar
By Callum
at 2009-07-07T11:58
有人幫我寫好一個make檔 我只要按make就會執行一串事情 請問如果我要修改這個make檔的內容 該打什麼指令呢? 甘溫atat - ...

vim function link 要怎麼用阿?

Linda avatar
By Linda
at 2009-07-07T11:54
請問一下 我在用vim trace code的時候想使用 ctrl + ] 直接link到function的程式碼位置 但卻出現了 E257: cstag: tag not found 請問有經驗的各位 是甚麼問題阿? - ...